Solved

Resolving #NA results from a vlookup

Posted on 2007-03-22
4
934 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:roos01
roos01 earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now