SOLVED

3-level IF and VLookup formula is generating a #N/A error

New Contributor

I created a formula that performs the following:

* checks for specific content in one cell (E4)

* if that is correct, it compares another cell (D10) with a table in the second sheet, and then installs content from a specific column in that table

* if it is not correct, it checks to see if the original cell (E$) matches other content and then does the same table comparison again

There are three potential pieces of data for E4, so I created a multilevel IF statement with the VLOOKUP formulas. As long as there is content in D10, this formula works and I get the desired result. If D10 is blank, the result is #N/A. 

Thoughts on how to make that #N/A result in a blank space instead? 
The formula:
=IF($E$4="MOQ7",(VLOOKUP(D10,'2ndtabsheet'!A:E,3,0)),(IF($E$4="MOQ5",(VLOOKUP(D10,'2ndtabsheet'!A:E,4,0)),(IF($E$4="MOQ3",(VLOOKUP(D10,'2ndtabsheet'!A:E,5,0)),"")))))

 

2 Replies
best response confirmed by Clintonious_AC (New Contributor)
Solution

@Clintonious_AC Use IFERROR. The formula would then look like this:

 

=IFERROR(........................., "") where you write your formula (without "=") on the dots.

That was the solution.
Thank you.