Can VLOOKUP be fine-tuned?

Csibész

New Member
Joined
Nov 17, 2005
Messages
10
Hi,
Given a large number of books to label and sort in a small library. Authors and titles are in an Excel2010 workbook under win7 OS. Strings are grouped in alphabetical categories (Ygroup table). Using VLOOKUP function, the authors are assigned id#s as per the Ygroup table categories.

excelpture.jpg


For some reason some of the authors would not fall where they should (id# marked with red). It appears space and dash are ignored in VLOOKUP.

Any idea how to solve these anomalies?
Thanks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Your formula is =VLOOKUP(F3, Ygroup, 3, TRUE). That last argument is TRUE or FALSE.

If it's TRUE, VLOOKUP will find an approximate match, which is what's happening in your case. If you want to find an exact match, just change TRUE to FALSE. :cool:

(As far as I know, VLOOKUP doesn't ignore any characters).
 
Upvote 0
Don't know if you tried to post some sample data, but if you did, it didn't come through.

Can you post some sample data and show what you have tried?
 
Upvote 0
I am not permitted to follow links :(

Can you show ( here) a sample of what you are working with, and what formula you are using?
 
Upvote 0
I am not permitted to follow links :(
Can you show ( here) a sample of what you are working with, and what formula you are using?

Oh, that's too bad... I'll try to type it in...

..A.......B.......C.....D..E...F................G
1 Limits table (Ygroup)....Results..............expected
2 from....to&incl id#......id# author...........id#
3 Y.......Yaz.....10.......70..Young-collection 60
4 Yb......Yd......20.......10..Yamamoto.........10
5 Ye......Yn......30.......60..Young Chris......50
6 Yo......Youm....40.......70..Youngabond V.G...70
7 Young A Young Z 50.......80..Yuille Cory......80
8 Young...........60.......20..Ybsen............20
9 Younga..Yr......70
0 Ys......Yul.....80
1 Yum.....Yz......90

in column E: =VLOOKUP(F3,Ygroup,3,TRUE)


After this "minor" exercise, ahem, may I suggest you to turn on image viewing? Life would be simpler and more colourful... :-)
 
Upvote 0
Did you try my answer? I believe it's correct. You must use FALSE in your VLOOKUP if you want exact matches.
 
Upvote 0
Did you try my answer? I believe it's correct. You must use FALSE in your VLOOKUP if you want exact matches.

You would be correct if an exact match was to be had. In my case it is a string that needs to find it's slot between two string limits. So it has to be set TRUE. And true to form with FALSE I get the familiar #N/A as a result.

For example, take row 7:
7 Young A Young Z 50
My limits are Young A and Young Z. Therefore, any string that falls between these two should take the value of 50. Young Chris would, of course, belong to this set, yet instead of 50 the VLOOKUP function assigns 60 to the record, which is incorrect.

I would like to avoid macros if a function could be used. So, here is hoping that FDibbins has an answer that both of us will find useful...
 
Upvote 0
One thing to note is that if you use TRUE in VLOOKUP your data table "Limits table" has to be sorted in ascending order.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top