Sub topic 10
Fixing #REF!, #NAME?, and #DIV/0! Errors
Assume you can open a spreadsheet, enter values, and use basic operators such as +, -, *, and /. This chapter focuses on errors caused by cell, range, sheet, and named-range references.
A formula error is a message in a cell that tells you Sheets cannot evaluate the formula as written. Read the error first, then inspect the references and inputs that the formula uses.
A quick diagnosis
| Error | Common cause | First check |
|---|---|---|
| `#REF!` | A referenced cell, range, or sheet no longer exists | Look for broken or deleted references |
| `#NAME?` | Sheets cannot recognize a function or name | Check spelling, quotes, and named ranges |
| `#DIV/0!` | The formula divides by zero or a blank cell | Check the denominator |
A useful debugging process is:
- Select the cell with the error.
- Read the formula in the formula bar.
- Identify every reference, including references on other sheets.
- Test suspicious parts in separate cells.
- Repair the reference or handle the invalid input.
- Copy the corrected formula only after testing it.
Fixing `#REF!`
#REF! means that part of a reference is invalid. It often appears after you delete a row, column, or sheet used by a formula. For example, a formula may change from a valid reference to this:
=SUM(B2:#REF!)Undo the deletion if possible. Otherwise, replace the broken reference with the correct cell or range:
=SUM(B2:B10)A copied formula can also produce an invalid reference when it moves beyond the intended layout. Check whether relative references should be absolute. For example, a tax calculation should keep using the rate in F1:
=B2*$F$1References to other sheets can break when a sheet is renamed or removed. A sheet name with spaces must be enclosed in single quotes:
='Sales Data'!B2Fixing `#NAME?`
#NAME? means Sheets cannot identify a name in the formula. Common causes include:
- A misspelled function, such as
=SMM(B2:B10)instead of=SUM(B2:B10). - A misspelled named range.
- Text used without quotation marks.
- A sheet name with spaces written without single quotes.
If A1 contains a sheet name, this reference is valid:
=INDIRECT("'"&A1&"'!B2")Check named ranges under Data > Named ranges. The name must exist and must match the formula exactly. A named range can make a formula clearer:
=SUM(SalesAmount)If SalesAmount was renamed or deleted, Sheets returns #NAME?.
Fixing `#DIV/0!`
#DIV/0! occurs when the denominator is zero or blank. This formula fails when C2 is empty or contains zero:
=B2/C2If a blank result is appropriate until data arrives, test the denominator first:
=IF(C2=0,"",B2/C2)You can also return a label:
=IF(C2=0,"No denominator",B2/C2)IFERROR handles any error, but it can hide unrelated problems. Use it when the fallback is intentional:
=IFERROR(B2/C2,"Check inputs")A reference-error workflow
Exercise
Cell D2 contains =B2/C2, and C2 is blank. Write a formula that displays 0 instead of #DIV/0!.
Show answer
=IFERROR(B2/C2,0)