Vlookup and #N/A

lynx1971

New Member
Joined
Oct 13, 2010
Messages
22
Hi everyone,

I have the following Vlookup formula =VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0) and it works just fine, but if the input cell R26 is empty I get a #N/A in the relevant cell. I tried searching for an answer in the help section in Excel itself, but it is returning replies on how to use the help files :). While it does not affect the worksheet at all, I'd rather have just an empty cell instead of #N/A.

Thanks in advance,

Lynx
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi everyone,

I have the following Vlookup formula =VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0) and it works just fine, but if the input cell R26 is empty I get a #N/A in the relevant cell. I tried searching for an answer in the help section in Excel itself, but it is returning replies on how to use the help files :). While it does not affect the worksheet at all, I'd rather have just an empty cell instead of #N/A.

Thanks in advance,

Lynx

If you are on Excel 2007 or later...

=IFERROR(VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0),"")

If on a previous version...

1) VLOOKUP is expected to return text...

=LOOKUP(REPT("z",255),CHOOSE({1,2},"",VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0)))

2) VLOOKUP is expected to return a number...

=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0)))
 
Upvote 0
Try wrapping an iserror around the vlookup. That way you'll trap all errors not just if R26 is empty. It'll be something like this:-
=if(iserror(VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0)),"",VLOOKUP(R26,Sheet1!$B$2:$F$28,5,0))
 
Upvote 0
SOLVED Re: Vlookup and #N/A

Thank you everyone who replied. Will try out your suggestions tomorrow morning when I get to the office.

Cheers,

L
 
Upvote 0
Ok I've tried using all the formulae above but to no avail. The sheet on which the original formula is located is simply called KIB. I've MS office 2003. What am I doing wrong?

Thanks in advance,

Lynx
 
Upvote 0
maybe
=IF(ISNA(VLOOKUP(R26,sheet1!$B$2:$F$28,5,FALSE)=TRUE),"",VLOOKUP(R26,sheet1!$B$2:$F$28,5,FALSE))
 
Upvote 0
This is the formula I am currently using in cell the cell just adjacent to cell R26:
=VLOOKUP(R26;KIB!$B$2:$F$28;3;0)

It's fine, but if there is no data in the first cell then it shows #N/A.

The data it is trying to locate is based on the table below where the first column are the codes and the 2nd and 3rd columns are the values which are looked up and placed in the desired position.

120 1760ABCD12 6062100000
130 1760ABCD13 6062100001
140 1760ABCD14 6062100002
150 1760ABCD15 6062100003
160 1760ABCD16 6062100004

TIA
 
Upvote 0
Try:-
=if(iserror(VLOOKUP(R26;KIB!$B$2:$F$28;3;0)),"",VLOOKUP(R26;KIB!$B$2:$F$28;3;0))

Replace the "" in the middle with 0 if it helps.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,287
Members
452,902
Latest member
Knuddeluff

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