Advanced Computing

Lesson

How to Handle Errors in Excel

, Comment regular icon0 comments

In this lesson, we will explore the main types of errors in Excel, how to interpret them and which functions can help correct or work around them.

Writer image

translated by Cards Realm

Writer image

revised by Leon

Edit Article

📌 Error messages that exist in Excel

When a formula cannot be calculated correctly, Excel displays an error code. Below are the most common errors:

Ad

ErrorMeaningMost common cause
#N/DValue not availableVLOOKUP don't find a value.
#VALUE!Value ErrorText in a mathematical equation.
#DIV/0!Division by Zero=A1/0 ou empty cell.
#NAME?Name ErrorDigitation error (ex: =SUME insteady of =SUM).
#REF!Reference ErrorCell removed or invalid reference.
#NUM!Number ErrorNumber too large or impossible (ex: =SQRT(-1)).
#EMPTY!Spill ErrorInterval don't use matrix
#######Cell too small to appear valueLength of the cell not big enough
#DUMP!Not enough space for the resultSomething is written bellow the cell

🔍 How to Interpret and Correct Errors?

#N/A (Value not found)

Cause: Functions such as VLOOKUP, HLOOKUP, or INDEX/MATCH do not find the value you are looking for.

Solution: Check if the value exists in the table.

Use IFERROR to display a custom message:

=IFERROR(VLOOKUP(A1, B1:C10, 2, FALSE); "Not found")

#VALUE! (Incompatible data)

Cause: Attempting to use text in mathematical operations or functions.

Solution: Check if the data is in the correct format.

Use ISNUMBER(), ISTEXT() or ISBLANK() to validate before calculating.

DIV/0! (Division by zero)

Cause: Division where the denominator is zero or empty.

Solution: Use IF to avoid division:

=IF(B1=0; "Error"; A1/B1)

#REF! (Invalid reference)

Cause: Deletion of a referenced cell or incorrect copying of formulas.

Solution: Check references in the formula. Use defined names to avoid broken references.

#NUM! (Number problem)

Cause: Invalid numbers (e.g. square root of negative).

Solution: Use IF to validate:

=IF(A1>=0; ROOT(A1); "Invalid")

🛠 Functions to Handle Errors in Excel

FunctionUse
IFERROR()change any error for a value. Ex: =IFERROR(A1/B1; 0)
IF()Test a condition before executing the formula Ex: =IF(B1>0; A1/B1; "Invalid")
ISERROR()Verify if cell have error. Ex: =ISERROR(A1) → TRUE or FALSE.
ISNUMBER()Verify if cell is a number. Ex: =ISNUMBER(A1) → TRUE or FALSE.
ISBLANK()Verify if cell is empty. Ex: =ISBLANK(A1) → TRUE or FALSE.

Exercises

ProductPriceStockSales
Apple5,00108
Banana3,0005
Orange4,001512
Avocado3,5000
WatermelonErro53

1. Calculate the unit selling price (Price / Sales). Handle error if Sales = 0.

2. Calculate availability in %(Inventory / (Inventory + Sales)). Check the new column for errors.

3. Search for "Pear" and if it does not exist, return "Does not exist".

4. Calculate total revenue (Price times sales), check if it is number before multiplying.