Match/Index Formula Return Two Names based on Lookup Criteria of Two Numbers & Semicolon

cmkarnes

New Member
Joined
Jan 19, 2015
Messages
23
Hi, I am working with a large Excel table and the data is downloaded from an MS Query. There is a column which brings in employee ID numbers. I have set up an Index/Match formula & associated lookup table which is working perfectly in returning the actual employee names in a different column on the main worksheet; however, when the data filters in, there are cases where there are two Employee ID #s in the same cell separated by a semicolon (i.e., 1, 2, 3, 4;7, 2;3, etc.). This is supposed to be like that.

The array table is set up like this, and the last row shows how I would like the numbers with the semicolon to be returned :

ID# Employee Name
1 EXAMPLE NAME 1
2 EXAMPLE NAME 2
3 EXAMPLE NAME 3
2;3 EXAMPLE NAME 2/
EXAMPLE NAME 3

My formula looks like this:
=INDEX(EMP_NAME,MATCH(LOOKUP_NUMBER,EMP_ID_NUMBER,0)) – this returns the correct results, but of course the cells referencing the items with semicolons returns the N/A error which I expected.

How do I modify the formula so that it recognizes the two numbers and returns the two different names in the same cell? I’ve researched extensively, but can’t seem to grasp it.

Thanks so much.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Perhaps this...
A​
B​
C​
D​
1​
11​
aa
11​
aa
2​
22​
bb
22​
bb
3​
33​
cc
33​
cc
4​
11;22aa;bb
B1=IFERROR(VLOOKUP(A1,$C$1:$D$3,2,0),VLOOKUP(--LEFT(A1,SEARCH(";",A1,1)-1),$C$1:$D$3,2,0)&";"&VLOOKUP(--MID(A1,SEARCH(";",A1,1)+1,99),$C$1:$D$3,2,0))

C1:D3 = the lookup table
 
Upvote 0
Thank you for taking the time to do this! This has really clarified things for me. These things get so complicated and confusing! Thank you again! C
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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