How to calculate the range (max − min) across multiple fields in a form
If you've got a set of integer or number fields in a form and you want to automatically work out the difference between the highest and lowest values, you can do it with three Calculation fields. This is useful for things like checking variation across multiple weight checks, temperature readings, or sample measurements on a line.
What you'll build
Five integer fields (your input values), plus three calculation fields:
- Max — finds the highest value
- Min — finds the lowest value
- Range — subtracts Min from Max
You can hide Max and Min once it's working if you only want operators to see the Range.
Step 1 — Add your input fields
Add five integer fields with unique names. In this example we've used value_1 through value_5.

Keep the field names consistent — the calculations below reference them exactly.
Step 2 — Add the Max calculation field
Add a Calculation field called Max and paste this into the formula:
(data["value_1"]>=data["value_2"]?data["value_1"]:data["value_2"])>=(data["value_3"]>=data["value_4"]?data["value_3"]:data["value_4"])?((data["value_1"]>=data["value_2"]?data["value_1"]:data["value_2"])>=data["value_5"]?(data["value_1"]>=data["value_2"]?data["value_1"]:data["value_2"]):data["value_5"]):((data["value_3"]>=data["value_4"]?data["value_3"]:data["value_4"])>=data["value_5"]?(data["value_3"]>=data["value_4"]?data["value_3"]:data["value_4"]):data["value_5"])
Step 3 — Add the Min calculation field
Add a Calculation field called Min and paste this in:
(data["value_1"]<=data["value_2"]?data["value_1"]:data["value_2"])<=(data["value_3"]<=data["value_4"]?data["value_3"]:data["value_4"])?((data["value_1"]<=data["value_2"]?data["value_1"]:data["value_2"])<=data["value_5"]?(data["value_1"]<=data["value_2"]?data["value_1"]:data["value_2"]):data["value_5"]):((data["value_3"]<=data["value_4"]?data["value_3"]:data["value_4"])<=data["value_5"]?(data["value_3"]<=data["value_4"]?data["value_3"]:data["value_4"]):data["value_5"])
Step 4 — Add the Range calculation field
Add a Calculation field called Range with this simple formula:
data["max_calc"]-data["min_calc"]
Step 5 — Test it
Enter these values into Value 1–5: 10, 25, 15, 30, 20
You should see:
- Max = 30
- Min = 10
- Range = 20
Adapting it to your own form
If your fields are named differently, just replace value_1 through value_5 in the formulas with your actual field names. Field names are case-sensitive and must match exactly, including any spaces.


