Solved

Excel vLookup not working

Posted on 2013-12-11
4
313 Views
Last Modified: 2013-12-11
I'm stumped as to why C24 (and a few others in that set) does not work. it does seem to work if i use numbers instead of text.


I'm sure this should work with text.

Any help?


vlookup-test.xlsx
0
Comment
Question by:tetrauk
[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
  • 2
4 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39713045
For C24, you should be using a formula like:
=VLOOKUP(A24,PricingTable,IF($B$24>10,3,IF($B$24>5,4,5)),FALSE)

Your IF function had been referencing the wrong row (row 23). Also, the VLOOKUP should use FALSE as the last parameter because approximate matches for A24 are not acceptable--you want an exact match.
0
 
LVL 1

Author Closing Comment

by:tetrauk
ID: 39713053
The locked reference for B23 was fine, that was deliberate, the sheet is not actually counting fruit in real life.

However i had misunderstood the last option, i thought the true was setting it to find exact matches only, but it appears that false does that.

This has been driving me nuts for an hour.......oh how i love and hate formulas!!!
0
 
LVL 1

Author Comment

by:tetrauk
ID: 39713055
P.S. in what way is 'Melon' similar to 'Pear' how does Microsoft decide this!!!
0
 
LVL 81

Expert Comment

by:byundt
ID: 39713068
Microsoft had to match what Lotus 123 did with their VLOOKUP. So the syntax is admittedly confusing.

TRUE means that the first column of the lookup table has been sorted in ascending order, and you do not require an exact match. VLOOKUP uses a binary search, so it is very fast. It is good for bracket pricing (or income tax calculations), where the first column of the lookup table lists the bottom of each bracket. Suppose the first two bracket bottoms are 0 and 5. If A24 equals 1, then VLOOKUP will return a value from the 0 row of the lookup table.

FALSE means that the first column of the lookup table has not been sorted. An exact match is required, so VLOOKUP searches each row of the lookup table (much slower than a binary search). For price lists, employment records and the like, this is the form of VLOOKUP that you would need.

While your remark about the similarity of Melon and Pear is right on point, VLOOKUP with TRUE would be used more appropriately with a lookup table like this:
Qty      Disc.      Bracket
0      0%      0 to 4
5      10%      5 to 9
10      15%      10 to 24
25      20%      25 to 99
100      25%      100 and over
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

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.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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