4

I'd like to give a discount based on the number of camp sessions signed up for in a repeating section but can't figure out the formula for doing that. Help?

In the repeating section called "Camper Information" I have a choice box called "sessions":

Sessions

July 1-5 $225

July 7-12 $225

July 14-19 $225

July 21-26 $225

I'm trying to make a calculation that will do:

number of sessions > 1 but < 3 gives a 5% discount

number of sessions > 4 gives a 10% discount

https://www.cognitoforms.com/Edenacres1/SummerOutdoorsSignUpForm

0

1 Answer 1

1

Calculations for Repeating Sections in Cognito Forms, allow you to easily filter and total lists of structured information.

You can find detailed documentation for calculations involving repeating sections here: https://www.cognitoforms.com/support/51/calculations/repeating-sectionstables

For your specific example, the following calculation will automatically calculate the number of selected sessions across all repeating sections:

=CamperInformation.Sum(Sessions.Count)

You can then use this inside a discount calculation for a Price field outside of the repeating section as follows:

=(
   if CamperInformation.Sum(Sessions.Count) > 3 then -0.1 
   else if CamperInformation.Sum(Sessions.Count) > 1 then -0.05 
   else 0
 ) *
 CamperInformation.Sum(Sessions_Amount)
2
  • Talk about kindness from strangers. Thanks so much, the formula worked perfectly! Dec 27, 2015 at 18:27
  • Glad it worked!!! Dec 30, 2015 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.