#REF!
This error occurs when a cell reference (cell reference: The set of coordinates that a cell occupies on a worksheet. For example, the reference of the cell that appears at the intersection of column B and row 3 is B3.) is not valid.
Optionally, click the cell that displays the error, click the button that appears , and then click Show Calculation Steps if it appears.
Review the following possible causes and solutions.
Deleting cells referred to by other formulas, or pasting moved cells over cells referred to by other formulas
Change the formulas, or restore the cells on the worksheet by clicking Undo immediately after you delete or paste the cells.
Using an Object Linking and Embedding (OLE) link to a program that is not running
Start the program.
Linking to a Dynamic Data Exchange (DDE) topic such as "system" that is not available
Make sure that you're using the correct DDE topic.
Running a macro that enters a function that returns #REF!
Check the function to see if an argument (argument: The values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.) refers to a cell or range of cells that is not valid. For example, if the macro enters a function that refers to a cell above the function, and the cell that contains the function is in row 1, the function will return #REF! because there are no cells above row 1.
HOWEVER---if you still want to do an IF statement and NOT correct the calculation reference -- you will use the iferror statement as below---
=IFERROR(F2, "0") this says if there is an error code in F@, then place a zero there...you can place anything inside the quotes ---like NA
=IFERROR(F2, "NA")
good luck :)
note---i am using excel 2007
hope this helps