Another way to say "having a party is for celebrating" is "The function of partying is celebration."