Need help getting rid of #N/A in my formula; please help

Copper Contributor

'=IF($AB$4='8B-Saginaw'!$C$9,VLOOKUP('Adjusted Inventory Summary'!F7,'8B-Saginaw'!$A:$F,6,0)). I need to return a zero or blank.

 

14 Replies

Hello @Pamr0703,

 

Return 0 if false:

=IF($AB$4='8B-Saginaw'!$C$9,VLOOKUP('Adjusted Inventory Summary'!F7,'8B-Saginaw'!$A:$F,6,0),0)

 Return blank if false:

=IF($AB$4='8B-Saginaw'!$C$9,VLOOKUP('Adjusted Inventory Summary'!F7,'8B-Saginaw'!$A:$F,6,0),"")

 

Neither of those worked

@Pamr0703 

 

The #N/A error suggests that the lookup_value is not located in the table_array. However, without a sample file, it would be impossible to confirm this suspicion.

How can I send you my file?
Click Reply > Click Browse files to attach below the text box > Find the file to attach

Please remove any sensitive information from your workbook.

@Pamr0703 

 

As suspected, the Stock Code "10CW" does not exist in the range "'8B-Saginaw'!$A:$F". Hence why an error of #N/A is returned.

So in this case how can I make it return a zero or blank instead of the #n/a

@Pamr0703 

 

That could be:

=IFERROR(IF($AB$4='8B-Saginaw'!$C$9,VLOOKUP('Adjusted Inventory Summary'!F7,'8B-Saginaw'!$A:$F,6,0),""),"")
You can wrap your formula in an IFERROR function as follows:

=IFERROR(IF($AB$4='8B-Saginaw'!$C$9,VLOOKUP('Adjusted Inventory Summary'!F7,'8B-Saginaw'!$A:$F,6,0)),"") - The "" at the end returns a blank cell if the formula results in an error; you can change this to 0 (or whatever you like, in fact) if you prefer a different result.
Thank you sooooo much!
Thank you soooooo much!

@Pamr0703 

 

Very welcome - If you do decide to use the IFERROR option, you can find a nice little macro at the below link, which will let you select the whole range of formulae and wrap them all in one go (you will need to delete the n/a in the code though, to return a blank cell)

 

https://excelhelphq.com/how-to-apply-iferror-on-many-cells-automatically-using-excel-vba-macro/