Help

Problem Formula and NaN

Topic Labels: Formulas
1087 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Geoffrey_Morin
4 - Data Explorer
4 - Data Explorer

Hello everyone !

I have to calculate the cost of a product. It can be made of Tissu, Wool or both.

The problem comes from the “total” columns with a Formula field. When I have some empty fields, the “total” field shows “NaN” because it divides by 0.
I can’t write the formula to avoid this.
Does anyone have a solution?
Thank you in advance,

My formula :
IF({Prix Tissu}=0, {Prix Tissu}/{Nb par tissu}=0){Prix Tissu}/{Nb par tissu}Airtable problème

2 Replies 2
augmented
10 - Mercury
10 - Mercury

Hi. You want something like the following.

IF(AND({Prix Tissu},{Nb par tissue}), {Prix Tissu}/{Nb par tissu})

The AND part is saying that all of the arguments need to be not empty. If that is true, then the division can take place. Otherwise, return nothing. No NaN will be displayed.

Good luck!

Thanks for your help. I finally find the good syntaxe :grinning_face_with_big_eyes: