Vlookup tweak to also look up partial string match

muhleebbin

Active Member
Joined
Sep 30, 2017
Messages
252
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Is it possible to have a vlookup do it's traditional function but then also find partial matches?

We have to fill in a vendor number for a credit card transaction form but the import from credit card statement descriptions are typically static however for fuel like Shell or Chevron they have unique numbers according to their locations. Rather than have 100entries for the various Shell's and Chevron's we go to (plus any new ones) would it be possible to find if the string contains "Shell" and still run the vlookup?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
How i would do it is create a supporting column that pulls the data out using RIGHT, LEFT, or MID formulas

i.e

1234567Chevron89 - Transaction line
i would create a support column to type =mid('cell location',find("Chevron",'cell location',1),len("Chevron"))

You could link "Chevron" to a given cell that just says "Chevron" so it can be shell, or AMPM or whatever and it adjusts to those lengths.
 
Upvote 0
From there you can Index, match or vlookup if you put that formula on the left side.

Or if it doesn't have a name and
"1234567" is the code for Chevron consistent out of a string of 1234567abcde357235

Use that LEFT, RIGHT, MID to extract that data into a support column still that it then reads off of.
 
Upvote 0
Thanks Michael for the suggestion, I think i'm following but can you clarify what you mean in regards to:
You could link "Chevron" to a given cell that just says "Chevron" so it can be shell, or AMPM or whatever and it adjusts to those lengths.

Below is a sample of the 'table array' that would be used in the vlookup/index match formula:

AP - Template.xlsm
AB
251GODADDY.COM 480-505-8855 AZ207
252GRANQUARTZ MOBILE 00NORCROSS GA212
253THE HOME DEPOT SEATTLE WA110
254IDAHO LUMBER HAILEY ID226
255OFFICE DEPOT #1078 0KENT WA273
256SHELL OIL 5744561310NORTH BEND WA396
257SHELL OIL 5744403210SEATTLE WA396
258SHELL OIL 5744466590KETCHUM ID396
Vendor IDs


Items in green are static, yellow - if we went to a new location it wouldn't find it, orange is an example of multiple entries but are the same vendor. Ideally i'd like a vlookup or index match function to be able to do it's typical function but then account for the variables like yellow and orange.

Hope that makes sense
 
Upvote 0
I found this as a quick google search for using cell color in formulas but I have never done that.
From what I am understanding you want like a vlookup(ORANGE,etc.,etc.)

 
Upvote 0
Hi Michael,

Sorry about the delay in response, just been slammed at work.

I only color coded the data to give specific examples of the different type of data. Green items - I could have as static entries in a traditional vlookup i.e. Granquartz Mobile in column A Granquartz in column B, Yellow - are items that if we went to a new store like in the Office Depot case then we would need to have an entry for each location we go to, like the examples in orange. Rather than do that, if the vlookup could look up traditional but also look up variable like Office Depot ##### and bring up Office Depot.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

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