Solved

Resolving #NA results from a vlookup

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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
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.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

734 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