Skip to main content
Solved

Using an If statement to change a NaN output to 0

  • May 17, 2022
  • 3 replies
  • 338 views

Hello!

I am working with a formula that is computing a rate for each area that is being updated from a submissions tab; however, not every area has data yet, so Airtable assumes 0. This means that in the future records we get the output NaN as we are dividing by 0 at the moment. Is there a function or if statement that can be used to detect if there’s and NaN output, and if so, set it to 0?

Thank you!

Best answer by TheTimeSavingCo

Hey James, try using an IF statement with ISERROR. Check it out here. To view the formulas, duplicate the base by clicking the title of the base at the top of the screen and then click the three horizontal dots on the right

The specific formula used in this case was:

IF(
  ISERROR(Number / {Number to divide by}),
  BLANK(),
  Number / {Number to divide by}
)

3 replies

TheTimeSavingCo
Forum|alt.badge.img+31

Hey James, try using an IF statement with ISERROR. Check it out here. To view the formulas, duplicate the base by clicking the title of the base at the top of the screen and then click the three horizontal dots on the right

The specific formula used in this case was:

IF(
  ISERROR(Number / {Number to divide by}),
  BLANK(),
  Number / {Number to divide by}
)

  • Author
  • Participating Frequently
  • May 17, 2022

Hey James, try using an IF statement with ISERROR. Check it out here. To view the formulas, duplicate the base by clicking the title of the base at the top of the screen and then click the three horizontal dots on the right

The specific formula used in this case was:

IF(
  ISERROR(Number / {Number to divide by}),
  BLANK(),
  Number / {Number to divide by}
)

This worked great! Thank you!


Forum|alt.badge.img+1
  • New Participant
  • October 17, 2023

Hey James, try using an IF statement with ISERROR. Check it out here. To view the formulas, duplicate the base by clicking the title of the base at the top of the screen and then click the three horizontal dots on the right

The specific formula used in this case was:

IF(
  ISERROR(Number / {Number to divide by}),
  BLANK(),
  Number / {Number to divide by}
)

Thank you this worked for me too!