Solved

Resolving #NA results from a vlookup

Posted on 2007-03-22
4
950 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

622 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