Catching errors in Airtable using logical functions

Plan availability

All plan types 

Platform(s)

Web/Browser, Mac app, and Windows app

ERROR() function overview

The ERROR() function is a logical function that returns an error value by outputting an #ERROR! message.

ISERROR() function overview

The ISERROR() function returns "true"—represented by "1" if the expression it references causes an error or "false"—represented by "0" if there is no error.

As an example, because you cannot divide a number by zero, this formula example would result as true: ISERROR({Price} / 0)

The screenshot below details various errors showing in {Error Types} using the ISERROR() function.

360098990014ERRORS003.jpg

Errors and logical functions

The Errors function is more powerful when coupled with IF statements. It outputs a warning or status whenever a formula results in an error, helping identify missing or incorrect values and displaying a generic message whenever an error is found.

ERROR() function coupled with IF statement example

Imagine you have a formula to calculate gross profit margin:

{Net Sales} -  {Cost of Goods Sold} ) /  {Net Sales} 

360098989994ERRORS004.jpg

In the screenshot above, the Infinity error is caused by a missing value in the net sales field. If you wanted only to run the gross profit margin formula whenever there was a value in {Net Sales}, you could write an IF statement like this:

IF(
  {Net Sales},
    ({Net Sales} - {Cost of Goods Sold}) / {Net Sales},
    BLANK()
)

However, this doesn't account for other potential errors within the table (a missing value in {Cost of Goods Sold} or a zero value in net sales). Rather than the formula above, use this formula:

IF(
   ISERROR(
      {Gross Profit Margin}
   ),
   "🚨 Alert"
)

360098989974ERRORS005.jpg