# Two of my calculations aren't working.

**mjgroup**Hi,

All my calculation fields are working except for one! Foiling Calculations and it's quite odd as half of it works and half doesn't

The Scenarios:

**1. User selects 1 side ( either Front Back or Side) ( I have done a calcucation for each)**Calculation should be

(75) + (1 x Number of Books x 0.5) = 80

THIS CALCULATION WORKS

**2. User selects 3 sides ( Front, Back, Spine)**Calculation should be

(3 x 75) + (3x Number of Books x 0.5) = 240

THIS CALCULATION WORKS

**3. User selects 2 sides ( Back, Spine)**(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION WORKS

**4. User selects 2 sides ( Front, Spine)**(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION DOES NOT WORK

**4. User selects 2 sides ( Front, Back)**(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION DOES NOT WORK

Thanks in advance,

Caroline

**Charlie**Hi Caroline,

I noticed that in your Form, I'm not really getting the conditions working, upon checking it I see that it was cloned from your original one and you have edited some fields.

1. You will see here that you have fields edited.

2. You will noticed that in the Conditions you will see that "Softback" is still the one being used, which is already deleted, the new one I believe is the "Softback Book" field or option.

3. When you click the specific condition, you will see that the selected is "Softback Book", but that does not mean it is being applied, it is just by default.

4. To make the conditions where, I suggest that you re-add or re-set up the conditions and check if they are using the right fields and options, especially the deleted ones you have.

This is also true why the conditions in your calculation is not working, a conflict from the old and edited fields are causing the problem.

I hope this helps. Let us know if after editing and making all the other conditions work and you are still having problems with the calculation, please let us know.

Thank you.

**mjgroup**Hi,

I’ve now edited properly all the changed fields, however the foiling calculations as first mentioned are still not working:

Foiling Calulation Totals should be as follows but the two highlighted in red below don’t result in the right calculation?

Calculation should be

(75) + (1 x Number of Books x 0.5) = 80

THIS CALCULATION WORKS

2. User selects 3 sides ( Front, Back, Spine)

Calculation should be

(3 x 75) + (3x Number of Books x 0.5) = 240

THIS CALCULATION WORKS

3. User selects 2 sides ( Back, Spine)

(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION WORKS

4. User selects 2 sides ( Front, Spine)

(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION DOES NOT WORK

4. User selects 2 sides ( Front, Back)

(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION DOES NOT WORK

Kind regards,

Caroline

Caroline Leonard I caroline.leonard@mjgroup.co.uk I 07582 899 190

[cid:image011.jpg@01D00FE4.4D37FF60]

[cid:image012.png@01D00FE4.4D37FF60] [cid:image013.png@01D00FE4.4D37FF60] [cid:image014.png@01D00FE4.4D37FF60] [cid:image015.png@01D00FE4.4D37FF60]

...**raul**Upon comparing your conditions that are not working with the formulas you posted, I see they're different:

4. User selects 2 sides ( Front, Spine)

(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION DOES NOT WORKIf I understand correctly, you're multiplying 2 x 0.5 x Number of Books. If this is correct you could leave this formula like: 150 + Number of Books since 2 x 0.5 = 1:

4. User selects 2 sides ( Front, Back)

(2 x 75) + (2x Number of Books x 0.5) = 160

THIS CALCULATION DOES NOT WORKSame goes with the formula above. You can leave it like this:

Now, please note that this formula will not give the 160 as the result for 1 book (it will give 151) since you are multiplying 2 x 0.5 = 1. In order to get 160 as the result for 1 book the formula should be 20 x 0.5 = 10 and the condition will be like this:

I've cloned your form here: http://form.jotformpro.com/form/43375337875971 and left the first formula 150 + Number of Books for Front & Back and 150 + 10 x Number of Books for Front & Spine, so you can compare both formulas and see if any of them works the way you want.

Feel free to clone the form to run more tests.

Let us know if this helps.

Thanks.**mjgroup**Hi,

Thanks for your help. I should have mentioned that in the example I was assuming a quantity of 10 books – so, 151 is correct if I only have a quantity of 1 book.

For some reason now, again assuming a quantity of ten books when I select all three values: front, back and spine a total value of 270 should appear in the foil calculations but it’s not….

(3 x 75) + (3x 10 x 0.5) = 270

Also is there any way to refresh the data when I go into preview mode?

Thanks,

Kind regards,

Caroline

Caroline Leonard I caroline.leonard@mjgroup.co.uk I 07582 899 190

[cid:image002.jpg@01D01078.0A6B79C0]

[cid:image004.png@01D01078.0A6B79C0] [cid:image006.png@01D01078.0A6B79C0] [cid:image008.png@01D01078.0A6B79C0] [cid:image010.png@01D01078.0A6B79C0]

...**Charlie**Hi,

Here's the edited cloned form that I have: http://form.jotformpro.com/form/43383107545959

Please see if it works as you expected. If it does, you can clone it.

The problem is that we don't restrict the conditions.

If we have a rule "If Foiling is equal to Front Cover" it equates to single calculation but it is also true for "If foiling is equal to Front Cover and the rest".

The logic might seem be confusing, but the point is that we add a restriction to them so that others won't be a conflict.

I hope this helps. Let me know if it works.

Thank you.