#REF! means the formula points at a cell that is not there. It is not a typo in a function name. A misspelled function is #NAME?, which How to fix the #NAME? error in Excel walks through on SUMM and on an unquoted TX. It is not a missing match. A missing match is #N/A.
Row 5 of a four-row list
The INDEX page uses four prices. Whole milk is $3.49, eggs are $4.29, oat milk is $4.79, and bread is $3.19. Row 3 of B2:B5 is oat milk.
=INDEX(B2:B5,5)| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Item | Price | Ask | Result | |
| 2 | Whole milk | 3.49 | 3 | 4.79 | |
| 3 | Eggs | 4.29 | 5 | #REF! | |
| 4 | Oat milk | 4.79 | |||
| 5 | Bread | 3.19 |
=INDEX(B2:B5,3)
=INDEX(B2:B5,5)
B2:B5 has four cells. Row 1 of that range is B2. Row 4 is B5, the bread. Row 5 would be B6, which is outside the range you passed, so INDEX returns #REF!. The INDEX page states that rule: a row or column number larger than the range, or a negative number, is #REF!. Counting down the whole sheet does not help. Row 1 is the first cell of the range in the formula.
A 0 is a different result. In current Excel, row 0 returns the whole column as an array. It is not #REF!.
Deleting the column the formula uses
The shelf counts on the #NAME? page are 12, 48, and 6. SUM of those three is 66, from =SUM(B2:B4).
Delete column B and the formula cannot follow the cells. Excel replaces the range with #REF!.
=SUM(#REF!)| A | B | |
|---|---|---|
| 1 | Formula | |
| 2 | Was 66 | #REF! |
=SUM(B2:B4)
=SUM(#REF!)
The 66 is gone because the cells are gone. Undo the delete, or point SUM at the column you moved the counts to. Do not wrap the broken formula in IFERROR. That hides the missing range the same way IFERROR hides the unquoted TX on the #NAME? page.
Deleting a column to the left of the range is a different edit. =SUM(B2:B4) becomes =SUM(A2:A4) when column A goes away, and it still adds whatever is in those cells. #REF! is the case where the referenced column itself was deleted.
A sheet name that is not on the file
INDIRECT turns text into a reference. On that page the sheet is Rates, the text B6 points at the Texas statewide rate, and the result is 6.25%.
=INDIRECT("Rate!B6")| A | B | |
|---|---|---|
| 1 | Address | Result |
| 2 | Rates!B6 | 6.25% |
| 3 | Rate!B6 | #REF! |
=INDIRECT("Rates!B6")
=INDIRECT("Rate!B6")
Rates!B6 is 6.25%. Rate!B6 is #REF! because no sheet has that name. The INDIRECT page says the same error when the text is not a cell on an open sheet, including a sheet in a closed workbook. Fix the text. A formula written as =Rates!B6, without INDIRECT, would have updated when you renamed the sheet. The text inside INDIRECT does not.
Inserting a row has the same trap, and it is not always #REF!. The text B6 stays B6 and shows whatever moved into that cell. You get a wrong rate, not an error. That is the case the INDIRECT page already shows.