Returns the first value if it isn’t an error and otherwise returns the second value
Sample usage
IFERROR([Task Name]15, "Data needed")
Syntax
IFERROR(value, value_if_error)
-
value
—The value, typically a formula, to test for an error -
value_if_error
—The value or formula to return if the first value results in an error
Usage notes
- This is similar to nesting the ISERROR function within an IF function; however, with IFERROR you don't have to retype or re-evaluate the expression.
- This function does not suppress errors caused by improperly constructed formulas. For example, #UNPARSEABLE, #CIRCULAR REFERENCE, #BLOCKED, #DATE EXPECTED, #CONTACT EXPECTED.
Examples
This example references the following sheet information:
Row # | Clothing Item | Item Number | Price Per Unit | Ship Date |
---|---|---|---|---|
1 | T-Shirt | C001 | $15.00 | 03/05/19 |
2 | Pants | C002 | $35.50 | 03/20/19 |
3 | Jacket | C003 | $200.00 | 02/27/19 |
4 | Jacket | C003 | #DIVIDE BY ZERO | 02/27/19 |
Given the table above, here are some examples of using IFERROR in a sheet:
Formula | Description | Result |
---|---|---|
=IFERROR(SUM([Price Per Unit]:[Price Per Unit]), "There is an Error in Price") | Sums the Price Per Unit column. If there is an error, the formula produces the value There is an Error in Price | There is an Error in Price |
=COUNTIF([Ship Date]:[Ship Date], IFERROR(MONTH(@cell) = 3, " ")) | Counts the values in the Ship Date column, if the month’s cell value equals 3 (March). If there is an error in the criteria, the formula produces a blank value. Rows 2 and 3 of the Ship Date column meet the criteria. | 2 |
=IFERROR(VLOOKUP("Jacket", [Clothing Item]:[Item Number], 2, false), " ") | Looks up the value Jacket in the Clothing Item column. If the formula finds the value, it produces the value in the Item Number column. If there is an error, such as a #No Match, the formula produces a blank value. | C003 |
Still need help?
Use the Formula Handbook template to find more support resources and view 100+ formulas, including a glossary of every function that you can practice working with in real time, and examples of commonly used and advanced formulas.
Find examples of how other Smartsheet customers use this function or ask about your specific use case in the Smartsheet online Community.