Solved

Resolving #NA results from a vlookup

Posted on 2007-03-22
4
942 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

828 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