#REF! Error in Excel (Understanding and Fixing)

Last Updated: March 24, 2024
puneet-gogia-excel-champs

- Written by Puneet

Most of the time, #REF! Error occurs when you have entered a formula in a cell, and the reference in that formula is invalid. So, for example, let’s say you have a formula that sums values from five cells above, and copy and paste that formula to a location where you only have three cells above; you will get the #REF! Error.

Copied Formula to a New Location

The example below shows the sum formula in cell A5, which sums values from the range A1:A5. You have relative cell reference in the formula.

ref-error-in-excel

And when you copy and paste this formula to cell C3, it returns #REF! in the result.

returns-ref-error

As I said earlier, when you copy the formula from A6 to C3, C3 doesn’t have five cells above, which means it’s impossible to refer to five cells from above.

#REF! Error with VLOOKUP

While using VLOOKUP, specify the column from which you want to get the value.

ref-error-with-vlookup

In the above example, we have specified three as col_index_num in the formula. But, in the lookup table, we have only two columns, and that’s why we have the #REF! Error in the result.

ref-error-in-the-result

You might face the same thing while using INDEX. When you try to look for a row or a column number that is higher than the total number of columns or rows you have in the referred data, this returns a #REF! Error in the result.

ref-error-while-using-index

In the above example, we are looking for the value in the 7th row in the range, but we have only 6 cells in total.

#REF! Error When You Delete a Column

In the example below, we have referred to the range A1:C3 in three parts.

ref-error-when-delete-a-column

But if you delete any of these columns, the formula will return a #REF! Error in the result.

formula-returns-ref-error

Other Reasons

While using the INDIRECT function, if you are referring to a cell or range from a closed workbook. There’s a chance that you will get the #REF! Error in the result.

ref-error-with-indirect-function

Fixing the #REF! Error

In Excel, when you are working formulas, it’s better not to trap the #REF! Error with the ISERROR or any other function. It’s better to fix the error when you get it in the result.

In most cases, you need to fix the reference to the range or cell, and your formulas will work fine. But it can be tricky sometimes to know exactly which reference is deleted or removed.

For example, when you delete a sheet from a workbook, it’s impossible to undo that action, and it’s harder to replace those references in the formula.

Finding All the #REF! Errors

With the help of Excel’s FIND option, you can find and select the cells in which you have the #REF! Error.

  1. Open the Find and Replace using Crtl + F.
  2. Enter the value #REF! in the “Find What”.
  3. Click on the “Options” button.
  4. Select “Values” from the “Look in”.
  5. Click on the “Find All” button.
find-all-ref-errors

After that, you can go to each cell and fix the formula.

Get the Excel File

Leave a Comment