#N/A error in Excel: what it means and how to fix it
#N/A means a lookup didn't find what it was looking for. Here are the six usual causes, how to spot each one on the sheet, and the fix, with a practice sheet.
#REF! means a formula points at a cell that isn’t valid. Most often the cell existed when the formula was written and was then deleted, with its whole row, column or sheet. Excel can’t guess what should take its place, so it writes #REF! into the formula where the reference was. The other common cause is asking a function for a column or row past the edge of its range.
The total in E2 was =B2+C2+D2: Q1, Q2 and Q3. Then column C, Q2, was deleted. Q3 moved left into column C, the total moved into D2, and the reference to the deleted column became #REF!:
| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | Rep | Q1 | Q3 | Total |
| 2 | Ana | 120 | 150 | #REF! |
If you just deleted it, press Ctrl+Z and everything comes back. Otherwise, edit the formula and replace #REF! with the right reference, or rewrite it as a range:
=SUM(B2:C2) → 270A range is the lasting fix. Had the total been =SUM(B2:D2) from the start, deleting column C would have shrunk it to =SUM(B2:C2) and it would have kept working.
VLOOKUP’s third argument counts columns inside its table, starting from 1. A2:B5 has two columns, so asking for column 3 points past its edge:
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Code | Item | Stock | Find | Stock | |
| 2 | P-14 | Bolts | 320 | P-22 | #REF! | |
| 3 | P-09 | Nuts | 1,150 | |||
| 4 | P-22 | Washers | 80 | |||
| 5 | P-03 | Screws | 640 |
Widen the table so it reaches the column you want:
=VLOOKUP(E2,A2:C5,3,FALSE) → 80The same happens when a column number was right until a column was deleted from the table. XLOOKUP avoids it: it takes the return column as a range, so there’s no number to go stale.
INDEX returns the item at a given position. Ask for a position the range doesn’t have and it returns #REF!. C2:C5 holds four stock levels, so there is no 5th:
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Code | Item | Stock | Find | Stock | |
| 2 | P-14 | Bolts | 320 | P-22 | #REF! | |
| 3 | P-09 | Nuts | 1,150 | |||
| 4 | P-22 | Washers | 80 | |||
| 5 | P-03 | Screws | 640 |
Let MATCH work out the position from the code instead of typing it:
=INDEX(C2:C5,MATCH(E2,A2:A5,0)) → 80Relative references move when you copy a formula. =A1 in B2 means “the cell one up and one left”. Copy it to B1 and it would point one row above row 1, which doesn’t exist, so the copy becomes =#REF!. Copy formulas only where the cells they point at exist, or lock the reference with $ (=$A$1).
A formula that reads another sheet, such as =Sales!B4, becomes =#REF!B4 when that sheet is deleted, and a deleted sheet can’t be brought back with Undo. INDIRECT, which builds a reference from text, returns #REF! when it points at a workbook that is closed: open that workbook and the formula recalculates.
Your task: In F2, return the stock of the code in E2. The formula =VLOOKUP(E2,A2:B5,3,FALSE) shows #REF!: write one that works.
Graded live| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Code | Item | Stock | Find | Stock | |
| 2 | P-14 | Bolts | 320 | P-09 | ||
| 3 | P-09 | Nuts | 1,150 | |||
| 4 | P-22 | Washers | 80 | |||
| 5 | P-03 | Screws | 640 |
Write the formula in the bar above, then press Check or Enter.
Keep column 3, but make the table reach the Stock column: A2:C5. End with FALSE for an exact match.
=VLOOKUP(E2,A2:C5,3,FALSE) Any formula that returns the same result passes.
Press Ctrl+F, search for #REF! with Look in set to Formulas, and choose Find All. The list shows every broken formula in the sheet; click one to go to it. Don’t hide #REF! with IFERROR: it always means the formula lost track of its data.
The formula refers to a cell that isn't valid. Most often the row, column or sheet it pointed at was deleted, and Excel replaced the reference with #REF!.
Press Ctrl+F, type #REF!, open Options, set Within to Workbook and Look in to Formulas, then choose Find All. Each result is a formula with a broken reference.
Undo (Ctrl+Z) restores it if you act straight away. After that, edit the formula, select #REF! in the formula bar and type or click the right cell or range in its place.
Its column number is larger than the number of columns in the table range. Widen the range, or lower the column number.
Guides that build on this one.
#N/A means a lookup didn't find what it was looking for. Here are the six usual causes, how to spot each one on the sheet, and the fix, with a practice sheet.
#NAME? means Excel doesn't recognise a word in your formula: a misspelt function, text without quotes, a missing colon. Find it and fix it, with a practice sheet.
#DIV/0! means a formula divided by zero or by an empty cell. Why it happens, averages of nothing included, and how to show a clean result, with a practice sheet.
Practise in a live grid that grades what your formula calculates, with a specific hint when it's wrong.
Runs in your browser · Graded on your result · No install