[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Excel vlookup problem

Posted on 2012-03-17
4
Medium Priority
?
189 Views
Last Modified: 2012-03-18
In the attached spreadsheet, I cannot understand why it does what it does.  How can D1 - D10 be #N/A, but then D11 - D20 yield that result?  It all makes no sense, even in this cheesy-easy example.  I made this simple test case because in my big complicated spreadsheet it wasn't working either
Book3.xls
0
Comment
Question by:johnsonsite
[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
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
ltsweb earned 2000 total points
ID: 37733527
You should use: =VLOOKUP(A1|$B$1:$C$20|2|FALSE)

It populated the answer "T" instead of "N/A"

The reason is False will do an exact match which sounds counter intuitive, but it works!

Hope that helps!
0
 

Author Comment

by:johnsonsite
ID: 37733618
Yes, not intuitive. All the web searching I did (hours worth) never exposed that trick.  It really should work fine the other way too, with TRUE (the default).  Stupid Microsoft.

Anyway, thanks a lot!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 37733703
Sometimes Excel help is the best place to look. My version says this about the final (4th) argument:

range_lookup    Optional. A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match:

If range_lookup is either TRUE or is omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.

Important   If range_lookup is either TRUE or is omitted, the values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP might not return the correct value.


Note that last part, TRUE will only work when the lookup array is sorted ascending - yours is sorted descending, hence #N/A results.

regards, barry
0
 

Author Comment

by:johnsonsite
ID: 37733838
Well, that was a bad example I sent out then. In my real spreadsheet the values are ascending. Either way, adding the FALSE parameter cured the problem, although it doesn't make sense.  If a match is an exact match, then it would ALSO satisfy being a partial match. The function just doesn't even work if the range_lookup is TRUE or omitted, it returns mostly garbage.

Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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 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.

656 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