When your Excel workbook has formulas that are linked to other workbooks/cells that have been deleted, you will get a #REF! error.
This means that the formula refers to a cell that isn’t valid.
To get rid of this error message we have to select the cell(s) with this error, press CTRL+H to bring up the Find & Replace dialogue box and enter the following:
Find What: #REF!
Replace With: (Leave this blank)
Press OK and it will clear the #REF! within the formula.