want to remove 'A' or 'The' from beginning or end of string in cell used for vlookup

george2021

New Member
Joined
Jan 20, 2021
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
In the two files that I am using for my vlookup, one file has 'A' or 'The' at the beginning of the string while the other has 'A' or 'The' at the end of the string - for example, 'A New Day' vs 'New Day, A' or 'The Great Lakes' vs 'Great Lakes, The'. How do I write my vlookup so that it trims 'A' or 'The' from the beginning or end of the string and searches on 'New Day' or 'Great Lakes'? Thanks!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You could simply use a wild card in your formula:

Excel Formula:
=VLOOKUP("*New Day*",table,column,False)
 
Upvote 0
It is a little unclear just what you have, where, and which way you are doing the lookup, but see if something like this helps.

21 10 18.xlsm
ABCDE
1A New Day2The Great Lakes5
2Great Lakes, The5New Day, A2
Lookup
Cell Formulas
RangeFormula
B1:B2B1=VLOOKUP("*"&MID(A1,2*(LEFT(A1,2)="A ")+1,FIND(",",A1&",")-1)&"*",D$1:E$2,2,0)
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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