# Can Jotform do some calculation based on birth date?

• wahchan
Asked on November 02, 2017 at 12:02 AM

Can Jotform do some calculation based on birth date (as attached image) and output a preset result image from the calculation?

• Nik_C
Answered on November 02, 2017 at 04:54 AM

I was able to make your calculation work, here is how:

1) I added eight number fields for day, month, and year:

2) Then I sum each of them into one number:

3) Below calculation, I added two number fields Number1 and Number2 which will extract the numbers from the calculation, in your example calculation is 30 so we need those number fields to be 3 and 0:

-For number1 this is the calculation that will extract that number:

-For number2 this is the calculation that will extract that number:

4) Finally, we sum those two into one:

But now there is another check that we need to perform, what if the code is a two number value i.e. 11, we need to extract that again, so further checking is implemented:

I added two more fields as you can see "Secret code Number check 1" and "Secret code Number check 2".

Finally, we sum those two:

You notice that we have two Secret code fields, so a condition that will say, if the second secret code is filled, hide the first secret code field, will solve that problem:

Note: All fields except the first Secret code field can be hidden, second Secret code field will show automatically if calculation reveals it.

Further, you can use conditional logic to show images or whatever you need based on that field: https://www.jotform.com/help/57-Smart-Forms-Using-Conditional-Logic

Feel free to check my form as well: https://form.jotform.com/73052449751963

Let us know if you have any further questions.

Thank you!

• wahchan
Answered on November 02, 2017 at 05:19 AM

Wow! Thanks for your suggested solution but your sample form seems not working.

• Nik_C
Answered on November 02, 2017 at 05:24 AM

Could you please share the test case that didn't work for you? Since I'm not able to find one that gives wrong calculation.

Maybe there is a test case that I didn't cover, but the calculation is, so far, working as intended.

• wahchan
Answered on November 02, 2017 at 06:01 AM

I am using your sample form at https://form.jotform.com/73052449751963 by enter 19/12/1978.

The final answer should be 1+9+1+2+1+9+7+8 = 3+8 = 1+1 = 2. But the answer from your from is 1.