Please note that the cell will return the first error that occurs when evaluating the formula, so if the cell has a #Name? error #Name? that occurs before the #Ref! error , there is no way to trap the potential error #Ref! .
Maybe something like:
=AND(ISREF(A1),ISERR(A1))
First check to see if the cell contains REFERENCE, and then check to see if it also contains an error.
I move on to using IsErr instead of IsError to ignore errors like N/A
source share