Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Field resulting in NaN breaks other formula.

Topic Labels: Formulas
Solved
Jump to Solution
602 1
cancel
Showing results for 
Search instead for 
Did you mean: 
janickbergeron
4 - Data Explorer
4 - Data Explorer

Hi, I am creating a CO2 emission calculator on airtable and i can't seem to get my formula right.

The formula in question is:

({Émission véhicule en Kg single} + {Émission véhicule en Kg total} + {Émission repas en Kg}1000
 
The formula either calculate using one destination ({Émission véhicule en Kg single}) or from multiple destinations ({Émission véhicule en Kg total})
 
In every case either {Émission véhicule en Kg single} or {Émission véhicule en Kg total} will be empty which result in the formula being:
(NaN + {Émission véhicule en Kg total} + {Émission repas en Kg}) / 1000
or
({Émission véhicule en Kg single} + NaN{Émission repas en Kg}1000
 
The formula for {Émission véhicule en Kg single} is: 
{Litre d'essence brulé single}*{facteur d'émission en kg/l single}
 
The formula for {Émission véhicule en Kg total} is: 
{Émission véhicule en Kg 1}+{Émission véhicule en Kg 2}+{Émission véhicule en Kg 3}
 
I have tried multiple things and nothing seems to work. Let me know if you have any idea how to fix this.
 
Thank you
 
 
 
1 Solution

Accepted Solutions
pressGO_design
10 - Mercury
10 - Mercury

I’m on mobile, so am shortening your field names.

Try

IF({single}, ({single} + {repas})/1000, ({total} + {repas})/1000)

See Solution in Thread

1 Reply 1
pressGO_design
10 - Mercury
10 - Mercury

I’m on mobile, so am shortening your field names.

Try

IF({single}, ({single} + {repas})/1000, ({total} + {repas})/1000)