Index, Match array formula with match starting from 02nd position?

Bering

Board Regular
Joined
Aug 22, 2018
Messages
185
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I would need your help with an Index, Match array formula which works partially.

In range F1:F16 I have the codes in the table below, obtained by combining 4 letters (M,S,Q,D) with nothing or 3 digits (1,2,3). These codes correspond to the types in range G1:G16.

In column A I have alphanumerical strings: what I need to do is to determine the type of those strings based on which code they contain (if any).

However, if the combination is at the beginning of the string then the result should be N/A (same if no match can be found).


For example:

String AM1H: result should be Type1

String L3J: result should be N/A (no match)

String M3H: result should be N/A (because even though there is a match this is at the beginning of my string)


The below index/match array formula works fine except when the match occurs at the beginning of the string.

The result for string M3 would hence be Type3 rather than the expected N/A.

Can anyone please suggest how the formula could be amended so that the match starts from position 2 in the string (or any other solution...)?

Thank you.

=+IFERROR(VLOOKUP(INDEX($F$1:$F$16,MATCH(1,COUNTIF(A1,"*"&$F$1:$F$16&"*"),0)),$F$1:$H$16,2,0),"N/A")


M1Type1
S1Type1
Q1Type1
D1Type1
M2Type2
S2Type2
Q2Type2
D2Type2
M3Type3
S3Type3
Q3Type3
D3Type3
MType0
SType0
QType0
DType0

<tbody>
</tbody>
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try

=IFERROR(VLOOKUP(INDEX($F$1:$F$16,MATCH(1,COUNTIF(A1,"?"&$F$1:$F$16&"*"),0)),$F$1:$H$16,2,0),"N/A")
 
Upvote 0
Solution
That works exactly as I wanted! Thank you sooo much :pray:

Try

=IFERROR(VLOOKUP(INDEX($F$1:$F$16,MATCH(1,COUNTIF(A1,"?"&$F$1:$F$16&"*"),0)),$F$1:$H$16,2,0),"N/A")
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,012
Members
449,060
Latest member
LinusJE

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