# Calculation Wizard giving incorrect values

**im2fst4u**I have issue with the calculation wizard not giving a correct value. I have checked outside of the form with a calculator with the values it is inputting and it is incorrect.

The box is called (Xi-FL)^2 Totals and is taking the 10 or so values and adding them incorrectly. This may have to take up to 100 values eventually so I need to figure out what is wrong now.

- JotForm Support
**jonathan**Hi,

From what I checked on the

field the calculation done was just a summation of all the other fields involve.**(Xi-FL)^2 Totals**So, the erroneous calculation is most likely to have happened on one or some of the fields that were summarize/added.

I am not able to understand yet the formula used on the other fields.

But to determine which of those added fields in

is erroneous you can try checking 2 at a time only.**(Xi-FL)^2 Totals**Example, add only the 2 fields

If the total is wrong, then one or both of the added fields must have incorrect calculation already. Repeating this process will enable to pinpoint which calculation is giving the wrong/incorrect values.

Hope this help. Please inform us if you were able to determine which calculation is erroneous and will check it also.

Thanks.

**im2fst4u**Okay after reworking my form I still cannot get this to work. I have everything working except the (Xi-FL)^2 Totals calculation. The odd part is that it works perfectly until you click submit. Once you do that it miscalculates.

According to my reference sheet in excel the numbers that contribute to (Xi-FL)^2 Totals are all correct. And adding them together by calculator results in the number on the reference sheet; 239.2675. (this value is also present before the submit button is clicked) But once the submit button is clicked the value changes to 175.3894. Waay off. (and this is with the correct values being added to (Xi-FL)^2 Totals as stated before)

Here are my testing values (laps) for you to try and see if you get the same results...

1:35.916 1:28.645 1:37.282 1:30.311 1:35.053 1:27.713 1:29.222 1:28.447 1:27.472 1:28.339Total Time=908.400

(Xi-FL)^2 Totals=239.2675

Variance=23.9268

BCRS=4.8915

btw Go to this form, the perfectly working one. (other than the mentioned problem)

http://www.jotform.ca//?formID=43238011957252- JotForm Support
**Welvin**The only problem I saw here is the individual calculation widget for each lap. You have this calculation to the form:

As you could see, the decimal point and the milliseconds come as text format. The correct should be like this:

Please correct that and check if the helps you resolve the problem.

Thanks

**im2fst4u**No this makes it worse.

Without the decimal point put in as a text it breaks what I'm trying to imput.Ex. Imputs are: Min=1 Sec=20 Milli=123

Should convert to: 80.123

But all that apears in the "lapX" box is 123.It only picks up the milliseconds.

This method to do what I need was made by EltonCris in this thread:

http://www.jotform.com/answers/367801-Convert-min-sec-milliseconds-to-sec-milliseconds-using-form-source-code#7

Maybe he would have a solution if you can't think of anything?- JotForm Support
**jonathan**Hi,

Can you please clarify that you want to make the

**calculation**via the form's source code instead?There will be different procedure if you will use the form's source code and the do the calculations outside the form via an independent javascript code.

If this is what you wanted to do, we can assist you with the custom calculation solution, but you have to guide us on all the formula/calculations you want to happen so we can create the code for it.

We will wait for your updated response.

Thanks.