Comma separated search value matching

tommsegers

New Member
Joined
Dec 8, 2022
Messages
5
Office Version
  1. 365
Platform
  1. MacOS
Hi everyone

I have a Sheet containing a column which contains comma separated values containing locations and a value

Item IDLocation results
112Location A :1;Location B:3;Location C:4;Location D:1
113Location A :5;Location F:1;Location X:9;Location Z:1
116Location AA:3

On a new sheet I have a list of all available locations and need to generate a table that looks like showing the value after the : of that specific location.
And preferable also adds the columns if the ID exists so i don't have to manually create every column header
Location112113116
Location A150
Location B300
Location AA 003

Another issue is that the Location names need to be an exact match as some names contain similar words like "Brussels North", "Brussels", "Antwerp North"

I have tried Search formulas without success so far

Thank you
Tom
 
Compatible with older versions of excel

=IFERROR(VALUE(IF(SEARCH($C2,VLOOKUP(D$1,$A$2:$B$4,2,0)),MID(SUBSTITUTE(VLOOKUP(D$1,$A$2:$B$4,2,0),";",REPT(" ",20)),1+FIND(":",SUBSTITUTE(VLOOKUP(D$1,$A$2:$B$4,2,0),";",REPT(" ",20)),SEARCH($C2,SUBSTITUTE(VLOOKUP(D$1,$A$2:$B$4,2,0),";",REPT(" ",20)))),3),"")),"")

Number of chars extracted can be changed by changing the value that's in bold in the formula.
 

Attachments

  • 1670754439827.png
    1670754439827.png
    31.9 KB · Views: 8
Last edited:
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,360
Messages
6,171,629
Members
452,412
Latest member
thomasleysen531

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