# Calculations depending on a previous field/loan amount

**afckredieten**Hello,

I already posted, and mailed my problem with my car loan calculator twice. Youd made my a perfect working car loan calculator, which a cloned and i'm futher working on it. But i'm still having a big problem.

https://form.jotform.com/53035203816952

But, i have looked, and tested a few options, i'm stuck. In Fact the loan duration has a min numbre of months, and different max number of months depending on the loan amount.

How can i integrate this option, i've tried with different duration fields and then worked with rules show, field 1 if loand amount is between X and Y. But this doesnt seem to be working. And at the start everything is shown what makes the calculator tool a bit messy.

So, please could you help me

this table gives you the wright min and max numbers of months (the min is always the same)

Loan amount min duration max duration 25001 3700 24 30 3701 5000 24 36 5001 5601 24 36 5601 7500 24 42 7501 10000 24 48 10001 15000 24 60 15001 20000 24 84 20001 999999999 24 120 Duration: steps off 6 months untill the max duration The table itself must be hidden, it mus only give the wright min and max validation on the field desired duration

Thanks for you're help

- JotForm Support
**david**Hi,

From the sounds of things, you could use "Update a form field value" conditions.

http://www.jotform.com/help/286-How-to-Populate-Field-with-a-Value-from-another-Field

You could base the updates off of the loan value. You would need to set your conditions for range of values.

IF loan amount > 0

If loan amount < 2500

Insert 30 into max duration

Something of that nature. I am not sure exactly what you are looking for, if you wouldn't mind letting us know how you would like the updates to be made, we can likely help you get it set up properly.

**afckredieten**Well, if the loan amount (leenbedrag) is

between 2501 an 3700, the max numbre of months is 30

If the loan amount is btweet 3701 and 5000 € the max duration is 36 months, and so one

meaning that visitors cant choose more months than the max in the table above, in the duration field.

so for instance a dropdown, or a spinner, field for loan duration and then the numbers

24, 30

24, 36

24,36,42,

24 36 42 48

... for every loan min and max in the table above

i would preffer the spinner

attention, the number must be taken with in the following monthly payement calculation

I've tried to work with the populate, but for sure i do something wrong, but i cant get it working. Now i tried it again, and i get wrong form when i hit preview button.

So i would be a happy customer if you could make this for me

**afckredieten**What i forgot

the visitors must be able to choose the months, with the min and max off the table. But also in steps of 6 months. So for 20.000€ they can choose 24 months but also 54/60/6.... with 120 the max

- JotForm Support
**david**For this, you would need to create a specific spinner for each range, then show the appropriate spinner for each range. The spinner field can be set with a minimum value, maximum value and a stepping amount:

You would also need to replace your text boxes with number fields. Your loan amount field "Kostprijs van het voetuig" is a text box so greater than/less than conditions will not work. Once you have a number field for your loan amount, you can create a condition such as this:

Then create a new condition for each range of values to show a different spinner that has a different maximum.

I set up the first few spinner and conditions to show you how it works:

https://form.jotform.com/53086184079967

You can clone the form to your own account to inspect the setup further:

http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

**afckredieten**Wait, i translated my form, the form is already made by a collegeau of yours

https://form.jotformeu.com/53085661448360

The goal is to calculate the monthly payements, and that part works, with the duration to fill in.

What you propose is not what i"m looking for.

In fact when somebody buys a car, 25.000€, an dos a downpayement of 5000€, the loan amount (calculation) will be 20.000€, the duration possibility's will be from 24 months tot 120 months

but for instance when somebody would pick 140 months, there must be an error that the max is 120.

When the loand amount is for instance 9000€, the duration max is 48 months, and when the client put 54 in, there need to be an error message.

Or when working with a dropdown, the choices stops at 48 for the 9000€, of with a spinner the max is 48 and doesnt go futher.

I hope i made myself clear what i'm looking for. And hoping i can do this in jotforms

**afckredieten**the way it works now with textfields, is composed by a collegeau, i only made the totall loan amount at the end of the period, so if he works with textfields he woudl have it's reasons for it

**afckredieten**i cloned you're form proposition

and i see that the calculation is complety wrong.

I'm looking for the monthly payements

AND

the there are some more rules needed.

The first is the car age

1. new

2. between and 3 and 5 years

3. older than 5 years.

This age determines the APR % (needed for the calculation later)

new is 3.24

between 3 and 5 years is 5.25%

and for older than 5 years

there is a seccond rule, for this option

the sub rule to determinate the APR is again the loan amount

Loan amount 25001 5000 13,50% 5001 999999999 10,50% The calculator worked, the monthly payement is correctly calculated.

Now i would like to integrate the loan duarion rule which depends also on the loan amount for the 3 ages of cars.

this is the complete logic needed in the tool

thanks for you're time and assistance

- JotForm Support
**david**That is the same setup I presented. You would just need to setup the conditions based on the calculation field instead of the number field I added.

**afckredieten**OK i will try it.

Thanks

**afckredieten**Is there a way to hide duration 1, 2, 3 and so one.

**afckredieten**A last question, i promise

For today anyway (-:

the monthly payement uses the duration normal field for its calculation

Do i also need to make the same number of "monthly payements" field so i can change everytime the "gewenstelooptijd"=duration in the calculation? and also with a rule somewhere that shows the right calcul. Probably also in the loan amount rules with the 2500 3700 show duration 1, than calcul monthly 1

- JotForm Support
**Mike**I am having hard time understanding the current requirements.

Are you still working on the min and max numbers of monthly duration (original post), or do you need help with the ARP part now?

What is the current form link?

If you need help with the ARP based calculations, I would like to suggest opening a new thread. Please also provide us with a form link in question, so we will be able to properly address everything.

**afckredieten**no i'm still working on the months part.

But my questions is if i have 8 duration spinners ( between 2500 and 3700, and futher up)

do i need also 8 different monthly payements calculation field, where you see above the formula, because the formula contained the old duration field. So if have now 8 different fields, i suppose i have to have 8 different monthly payement fields, so i can change resp the duration field in the calculation part? or is there another way to work

**Boris**I believe that this is the form that you were working on: http://www.jotformeu.com/form/53064268766363

The setup is a little confusing, but I have gone ahead and implemented the recommendations of my colleagues. You can see a simplified and edited form here:

http://form.jotformpro.com/53092038091956

As you can see, there is no need to have a separate Calculation field for each of the possible "Gewenste looptijd" Spinner fields that hold month values. What I have done is the following:

1. I have enabled the option on this form to

**Clear Hidden Field Values**>**Clear On Being Hidden**. (This option is found under Preferences > Advanced Settings.) This allows us to ignore the Spinner fields by simply conditionally hiding them.2. I have used a

**Number**field for "Te lenen bedrag", as recommended by my colleagues above. This allows for the Greater than and Less than conditions to work, based on teh value of the Number field.3. I have used a

**Number**field for storing "Gewenste looptijd", and I have set up conditions to update this number field with the value of "Gewenste looptijd" spinners.This field was also made hidden by clicking on its gear-shaped icon > Hide Field, so that your users can't see this field on the form.

4. I have updated all your conditions and calculations to use these two Number fields instead, so there is no need to have multiple Form Calculation fields on your form.

5. I have fixed some of the OR (if ANY match) conditions to be the correct AND (if ALL match) rules.

I believe you will be able to set conditions further to your liking. Please try out the edited form, and let us know if you need further assistance. Thank you.

**afckredieten**Thanks for all the work you guys already did. Realy helpfull, and apreciated.

But, when i open you're edited form, or http://form.jotformpro.com/53092038091956 for that matter

the duration (gewenste looptijd) is gone? so the monthly payement is not calculated?

**afckredieten**I given it another look to youre form and explination.

The point is that you hidden quite a lot. So the duration "gewenste looptijd" is not shown on the public form. That's the point, the visitors need to choose a desired duration, and the possibility's in duration is set by the loan amount. But now the field duration is complety gone on the public part. So what do i need to do to fix this

**afckredieten**sorry, never mind my last two comments, when i cloned youre form, and hit preview the form works.

So thanks, i'll work on this form to complete the calculator

**Jan**I understand, glad to hear that it is working now. Let us know if you encounter a problem and you need our help. Thank you.