Logical
Excel 2007
◉ 30 views
=IFERROR()
How to use the IFERROR function in Excel to trap and handle errors in a formula.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016Excel Web App
=IFERROR(value, value_if_error)
Hover argument names in the table for details.
Output typeMixed
Popularity50 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =IFERROR() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
value |
Any type | Required | The argument that is checked for an error. |
value_if_error |
Any type | Required | The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!. |
▣ Examples
▦ Data
| Cell | Value |
|---|---|
A2 |
Quota |
B2 |
Units Sold |
A3 |
210 |
B3 |
35 |
A4 |
55 |
B4 |
0 |
B5 |
23 |
A6 |
Quota |
B6 |
Units Sold |
C6 |
Ratio |
A7 |
210 |
B7 |
35 |
C7 |
6 |
A8 |
55 |
B8 |
0 |
C8 |
Error in calculation |
B9 |
23 |
C9 |
0 |
A10 |
Quota |
B10 |
Units Sold |
A11 |
210 |
B11 |
35 |
A12 |
55 |
B12 |
0 |
B13 |
23 |
A14 |
Quota |
B14 |
Units Sold |
C14 |
Ratio |
A15 |
210 |
B15 |
35 |
C15 |
6 |
A16 |
55 |
B16 |
0 |
C16 |
Error in calculation |
B17 |
23 |
C17 |
0 |
Checks for an error in the formula in the first argument (divide 210 by 35), finds no error, and then returns the results of the formula
=IFERROR(A2/B2, "Error in calculation")
Result:
6
Checks for an error in the formula in the first argument (divide 55 by 0), finds a division by 0 error, and then returns value_if_error
=IFERROR(A3/B3, "Error in calculation")
Result:
Error in calculation
Checks for an error in the formula in the first argument (divide "" by 23), finds no error, and then returns the results of the formula.
=IFERROR(A4/B4, "Error in calculation")
Result:
0
Checks for an error in the formula in the first argument in the first element of the array (A2/B2 or divide 210 by 35), finds no error, and then returns the result of the formula
=C2
Result:
6
Checks for an error in the formula in the first argument in the second element of the array (A3/B3 or divide 55 by 0), finds a division by 0 error, and then returns value_if_error
=C3
Result:
Error in calculation
Checks for an error in the formula in the first argument in the third element of the array (A4/B4 or divide "" by 23), finds no error, and then returns the result of the formula
=C4
Result:
0
§ Remarks
- If value or value_if_error is an empty cell, IFERROR treats it as an empty string value ("").
- If value is an array formula, IFERROR returns an array of results for each cell in the range specified in value. See the second example below.
✦ Tips
- If value or value_if_error is an empty cell, IFERROR treats it as an empty string value ("").
- If value is an array formula, IFERROR returns an array of results for each cell in the range specified in value. See the second example below.
⚠ Common Errors
#N/A
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: با IFERROR مقدار جایگزین برای #N/A تعیین کنید؛ منبع خطا را بررسی و اصلاح کنید.
#VALUE!
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: نوع دادهها و آرگومانها را بررسی کنید و با IFERROR مقدار جایگزین بدهید.
#REF!
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: ارجاعهای نامعتبر را اصلاح کنید و با IFERROR خطا را مدیریت کنید.
#DIV/0!
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: مقسومعلیه صفر را بررسی کنید و با IFERROR مقدار جایگزین برگردانید.
#NUM!
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: مقادیر عددی نامعتبر را اصلاح کنید و با IFERROR مدیریت کنید.
#NAME?
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: نام تابع یا محدوده را از نظر املا بررسی کنید و با IFERROR پوشش دهید.
#NULL!
The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Fix: عملگر محدوده را اصلاح کنید و با IFERROR مقدار جایگزین تعیین کنید.
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!