IF lookup

vxs

Board Regular
Joined
Dec 10, 2008
Messages
61
Hi All,
Pulling my hair out here googling vlookup, lookup, match index not sure which to use.

I wish to match the begining of the text in cell A1 against a list and it to return the relevant depot name in cell B1 for example.

Sometimes the begining of the text will be as short as 2 letters but sometimes due to similar depot names it will need to match it by a longer variable say by 6 characters

Example Data

Column A
MA00124645
MAN011344
LUT111356335
LUD111346467

<tbody>
</tbody>


Example Data To Match Against

MANMANCHESTER
MAMAIDSTONE
LUDLUDLOW
LUTLUTON

<tbody>
</tbody>


So if Cell A1 = MA0011234555 it will know to return in B1 MAIDSTONE
and say
Cell A2 = MAN847626822 it will know to return in B2 MANCHESTER

As I said sometimes the strings in column A get quite long and the text needed at the begining of the string can be as shorts as 2 letters or 6 but these letters always begining at the start of the string of data so hopefully I can always do a lookup/match via this info if I can work out how to do the lookup.

Any help would be much appreciated please.

Thank you
 
Last edited:
Lovely, thanks for that Marcílio_Lobão that has worked.

Hopefully I don't come across any other issues as this formula seems to do the trick.

Thanks all for responding especially
Marcílio_Lobão and FDibbins :pray:;)
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
MA00124645MAIDSTONELUDLUDLOW
MAN011344MANCHESTERLUTLUTON
LUT111356335LUTONMAMAIDSTONE
LUD111346467LUDLOWMANMANCHESTER

<tbody>
</tbody>

Try to sort D:E on D ascending and invoke in B2...

=LOOKUP(9.99999999999999E+307,SEARCH($D$2:$D$5,$A2),$E$2:$E$5)

If "begins with" is relevant...

=LOOKUP(9.99999999999999E+307,SEARCH("|"&$D$2:$D$5,"|"$A2),$E$2:$E$5)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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