# Complex calculation using calculate field or what do you suggest?

• tidychamps
Asked on January 17, 2017 at 06:40 PM

I am configuring the form to populate service rate based on 2 factors only - 1) House size and 2) Type of Service . That seems like a simple calculation however here are the problems:

When a customer select condition 1,  they have to choose one of 6 options under condition 2. Here is how it works:

Condition 1 - checkbox (10sf, 20sf, 30sf) - form responded will select one of the 3 options.

Condition 2 - checkbox (daily, 1x per week, 1x every 2 weeks, monthly, one-time standard, one-time deep, moving)

When they selected one of the options in condition 1, they have to choose one of the services in condition 2

example -

Case 1 - customer has 10sf but they have to select what service option they need

10sf and daily = service price for daily 10sf

10sf and 1x weekly = service price for 1x per week 10sf

10sf and 1x every 2 weeks = service price for 1x every 2 weeks 10sf

10sf and monthly = service price for monthly 10sf

... etc

Case 2 - customer has 20sf but they have to select what service option they need

20sf and daily = service price for daily 20sf

20sf and 1x weekly = service price for 1x per week 20sf

20sf and 1x every 2 weeks = service price for 1x every 2 weeks 20sf

20sf and monthly = service price for monthly 20sf

... etc

Case 3 - customer has 30sf but they have to select what service option they need

30sf and daily = service price for daily 30sf

30sf and 1x weekly = service price for 1x per week 30sf

30sf and 1x every 2 weeks = service price for 1x every 2 weeks 30sf

30sf and monthly = service price for monthly 30sf

... etc

I need help getting this together.

I think jotform can handle this but not sure if this is is too much for calculate/update field to handle, or if this is for math function or array, or whatever. I have stuggled with this for some time and someone out there could help me, that will be great.

I have attached what is expected on the result in a table

• Chriistian
Answered on January 17, 2017 at 10:42 PM

Please allow me some time to investigate this further and I will get back to you with a possible workaround. Regards.

• Chriistian
Answered on January 18, 2017 at 01:06 AM

Hello again,

Based on the information provided, I have setup a demo form that will calculate the rates based on your requirements. Please follow this link to view the demo: https://form.jotform.com/70168987091972 You can also clone it to your account by following this guide: How to Clone an Existing Form from a URL

The way I set it up is I first added a base rate as the calculation value for each of the options in the condition 2. You can add calculation values by following this guide: How to Assign Calculation Value

weekly = 20

1 every 2 weeks = 30

three weeks = 40

etc.

Then assign a calculation value for each option in Condition 1.

10sf = 0

20sf = 5

30sf = 15

Once this is done, I have added a calculation field where we will insert the calculated value.

I then setup several conditions that will add the calculation values from both radio fields. You can clone the form as instructed above to check each of these conditions. Here's a guide that may help: Smart Forms Using Conditional Logic

After that, you're all set. You can clone and modify the demo per your requirement. If you need further assistance, please let us know.
Regards.