Vlookup with "*" in the data field

808stu

New Member
Joined
May 2, 2018
Messages
5
I am using VLOOKUP (exact match)with a table that has the following values:
[TABLE="width: 500"]
<tbody>[TR]
[TD]AGE[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]AGE*[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AGE*ACRE[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Because of the asterisk, when I use the VLOOKUP function, it displays results from AGE* as 5 rather than 0 or nothing. I am using the VLOOKUP exact match, but I think Excel is confused with the "*" in the lookup field because it acts as a wildcard. My formula is: " =VLOOKUP(C7,TABLE,2,FALSE). Any help would be much appreciated. Thank you!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I've had the same issue in the past.
try changing your VLOOKUP to a MATCH instead.
 
Last edited:
Upvote 0
Try putting a tilde (~) in front of the asterisk.
Excel Workbook
ABCDEFGHIJ
1AGE5AGE~*
2AGE*11
3AGE*ACRE01
4
Sheet
 
Upvote 0
Sorry, I forgot to mention, the data with the asterisk is downloaded and I don't want to change the data. I've found adding any letter after "age" will resolve the issue, but there are hundreds of rows to make this change and many users will use this so I want to avoid making everyone from having to make these edits. Thank you
 
Upvote 0
You can use SUBSTITUTE in your formula to do it:

=VLOOKUP(SUBSTITUTE(C7,"*","~*"),TABLE,2,FALSE)
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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