Generate error-handling formulas for Excel functions
Scenario | Formula | Remarks |
---|---|---|
Hanlde Division by Zero (#DIV/0!) | =IFERROR(A2/B2, "Error: Division by Zero") | |
With VLOOKUP | =IFERROR(VLOOKUP(E2, A2:B10, 2, FALSE), "Not Found") | Returns "Not Found" instead of #N/A |
With SUM | =IFERROR(SUM(A1:A10), 0) | Returns 0 instead of an error message |
IFERROR with TEXT Function | =IFERROR(LEFT(A1, FIND(" ", A1)-1), A1) | |
with AVERAGE | =IFERROR(AVERAGE(A1:A10), "No Data") | |
IFERROR with MATCH | =IFERROR(MATCH(50, A1:A10, 0), "Not Found") | Handle Not Found Cases |
INDEX-MATCH Example | =IFERROR(INDEX(B2:B10, MATCH(E2, A2:A10, 0)), "Not Found") | Advanced Lookup Handling |