Lookup formula error

Perry M

New Member
Joined
Mar 25, 2002
Messages
14
I have a form that I use that collects numerical data from several operations. I use lookups to bring that data into another worksheet. My problem is that not all values I search for are always present.
Is there a way to have the lookup return a "0" instead of the "#N/A" error if the value I am looking up is not present?
I thought that I had seen this posted here before, but I have been unable to find it.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You can use:

=IF(ISNA(VLOOKUP($C$10,Suppliers!$A$2:$B$28,2,FALSE)),"",VLOOKUP($C$10,Suppliers!$A$2:$G$28,4,FALSE))

This is one that I use. If it gets an #N/A error it puts in "" (blank) otherwise it just puts the lookup in.
 
Upvote 0
It is annoying, but the solution that I use is as follows:

Let's say your lookup is:
=VLOOKUP(A1,$Z$1:$AA$99,2,FALSE)

Then I would use
=IF(ISNA(VLOOKUP(A1,$Z$1:$AA$99,2,FALSE)),0,VLOOKUP(A1,$Z$1:$AA$99,2,FALSE))

The ISNA() function tells you if you are going to get an N/A. If you are, then the IF statement puts a zero, otherwise, it lets the VLOOKUP recalc.

Bill
 
Upvote 0
Another one:

=IF(countif($A$2:$A$28,C10)=0,"",VLOOKUP($C$10,Suppliers!$A$2:$G$28,4,FALSE))

This post has come up time to time

Adam
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top