"*" in Formula but not as Wildcard

JWGoldfinch

Board Regular
Joined
Dec 23, 2009
Messages
50
I have some data in a column that I need to do a VLOOKUP on and the data contains an "*" Example "*AFF" and I need to find a way that I can find the exact match in another spreadsheet for "*AFF" without it using this "*" as a wildcard and returning "NBAFF" instead of "#N/A" when the value is not found.

How can I write my VLOOKUP comnmand to avoid using the "*" as a wildcard, it currently lookls like this

VLOOKUP(A2,CUSTOMERS!A:D,3,FALSE)

*AFF is not in the CUSTOMERS spreadsheet and I want it to return #N/A, instead of the name associated with NBAFF

Help Please this is a Rush Job.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hello JWGoldfinch,

To prevent Excel from seeing the asterisk as a wildcard character, prefix it with a tilde character (~).

This example will look for what is in cell A2 that starts with an asterisk.
=VLOOKUP("~*" & A2,CUSTOMERS!A:D,3,FALSE)
 
Upvote 0
Thank you, this helped a lot.

The "*" was not always the 1st pos, so the formula that appeared to work best for me was

VLOOKUP(SUBSTITUTE(A2,"*","~*"),'CUSTOMER'!A:D,2,FALSE)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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