Solved

Resolving #NA results from a vlookup

Posted on 2007-03-22
4
941 Views
Last Modified: 2008-02-20
I am using vlookup function and am getting numerous #NA results back.
I am pretty sure the function is working as expected but need to check  
I am trying to expand the function to bring back something more meaningful like 'no data found'
Any ideas how I can double check.
I am also getting some 0's in the results aswell

Grateful for any help, thanks
0
Comment
Question by:mugsey
4 Comments
 
LVL 33

Assisted Solution

by:Jeroen Rosink
Jeroen Rosink earned 100 total points
ID: 18770384
The formula could be somthing like:
to suppres the #NA you could us a formula like:
=IF(ISERROR(VLOOKUP(A2,C1:F1,2)),"No data found",VLOOKUP(A2,C1:F1,2))

I hope this works for you

regards,
Jeroen
0
 
LVL 13

Assisted Solution

by:WJReid
WJReid earned 100 total points
ID: 18770394
Hi,

You could use the Countif function to save doing 2 vlookups.

=IF(COUNTIF(B2:B400,B1)=0,"No data found",VLOOKUP(B1,B2:C400,2,FALSE))

Bill
0
 
LVL 13

Accepted Solution

by:
nike_golf earned 150 total points
ID: 18770606
You might also have to sort your data for correct results. I would also recommend using "False" in your formula to pull exact results.

"If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, VLOOKUP will find an exact match. If one is not found, the error value #N/A is returned."

=IF(ISERROR(VLOOKUP(A2,C1:F1,2,"False")),"No data found",VLOOKUP(A2,C1:F1,2,"False"))


NG,
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 150 total points
ID: 18770983
If you are getting zeroes back it means that there are zeroes or blank cells in the lookup data table.
If you get #N/A then it means there is no match. This can be for several reasons:
1. You are looking up a number stored as text against a number (or vice versa) - it is often easiest to do a manual check on some items returning the #N/A to determine this.
2. You have omitted the fourth argument for the VLOOKUP function or used TRUE, and your data is not sorted. If you use the formula Bill gave you, you will get exact matches only and your data does not need to be sorted.
3. The number is not in the list, either because it does not exist or because your range is incorrect.

HTH
Rory
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question