Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Problem Formula and NaN

Topic Labels: Formulas
412 2
cancel
Showing results for
Did you mean:
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?

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

2 Replies 2
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!

4 - Data Explorer

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