Calculation Form with 3 field 2 needed to calculate a 3rd [RESOLVED]

I want to be able to calculate the cost per 1000 units.

There would be 3 fields:
Cost per 1000, Total # of units, Total Cost
If you put in the first two it calculates cost{ Cost per 1000} * ({total # units}/1000) = total cost
If you put in {Total Cost}/{Cost per 1000} * 1000 = Number of Units
If you put in {Total Cost}/({Total # of units}*1000) = cost per 1000 units

Is that possible with forms?

The following documentation explains how you can create calculation fields: https://docs.gravityforms.com/using-calculations/

Thanks, I’ve looked at that, but it doesn’t answer my specific use case. I can do these each individually or with JavaScript. I was hoping GF would do it, so I didn’t have to hand-code it.

Hi Daniel. I think I understand the requirements. Given any two inputs, you calculate the third. The closest I could come with Gravity Forms is this: https://demo.chrishajer.com/calculations/

Look at that form and see if it comes functionally close to what you need. If you’re interested, you can download that form from here: gravityforms-export-2022-10-20.json.txt - Droplr

Save that file with any file name, but it has to have a .json extension. Then, go to your WordPress dashboard and then Forms → Import/Export → Import Forms and upload this file. Take a look at how that is configured and let me know if you have any questions.

Thanks, that’s really interesting putting the result as a conditional. I appreciate your sharing!

1 Like