Match value in pipe delimited string to a value in a list

toussaint31

New Member
Joined
Jul 29, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi - I wanted to see what the best method is to find a value in a pipe-delimited string in one cell that matches a value from a list and extract that value. Example:


MetricPipe Delimited Values
3112356|229531|229327|229533|229532
5556136|546778|558302|521840|518638|525922|523660|549684|550052|519098|524200
5525864|525928|556136|521574|522726|525866|525930|530730|536938|525922|525924|518634|524074|525894|521544|523030|518736|520478|543442


Desired Values
223559
525928
550052
229531


Desired Result:
MetricDesired Value Extracted from Pipe Delimited StringsPipe Delimited Values
3229531112356|229531|229327|229533|229532
5550052556136|546778|558302|521840|518638|525922|523660|549684|550052|519098|524200
5525928525864|525928|556136|521574|522726|525866|525930|530730|536938|525922|525924|518634|524074|525894|521544|523030|518736|520478|543442

Note - the actual Desired Values list is a couple thousand values. There will be exactly one value in each pipe delimited cell that matches a value in the Desired Value list.

Thank you for your help!
 
Last edited by a moderator:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I don't understand what you need. It is not very clear to me.
What are your inputs? what is your desired result? Why?

if for example for the first row your input is "3", and the string "112356|229531|229327|229533|229532"? Who do you get 229531 as a result? Or why that value?
What am I missing? What does the "3" represent?
 
Upvote 0
I don't understand what you need. It is not very clear to me.
What are your inputs? what is your desired result? Why?

if for example for the first row your input is "3", and the string "112356|229531|229327|229533|229532"? Who do you get 229531 as a result? Or why that value?
What am I missing? What does the "3" represent?
Sorry - That column is really just a placeholder. That column is a metric that's associated with all of those pipe delimited values. But I only care about one of the values and need to separate that value from the rest of them. Does that make sense?
 
Upvote 0
Separate the values, yes, not a problem. Something Like the formula below.
How to know which one to select is what I don't understand. On what criteria do you select a value? Do you have an index? The closest to another value? Pic randomly one of the values?

Book1
ABCDEFGHIJKLMNOPQRST
1112356|229531|229327|229533|229532112356229531229327229533229532
2556136|546778|558302|521840|518638|525922|523660|549684|550052|519098|524200556136546778558302521840518638525922523660549684550052519098524200
3525864|525928|556136|521574|522726|525866|525930|530730|536938|525922|525924|518634|524074|525894|521544|523030|518736|520478|543442525864525928556136521574522726525866525930530730536938525922525924518634524074525894521544523030518736520478543442
Sheet3
Cell Formulas
RangeFormula
B1:F1,B3:T3,B2:L2B1=TEXTSPLIT(A1, "|")
Dynamic array formulas.
 
Upvote 0
Maybe
Fluff.xlsm
ABCDE
1MetricPipe Delimited Values
22235593229531112356|229531|229327|229533|229532
35259285550052556136|546778|558302|521840|518638|525922|523660|549684|550052|519098|524200
45500525525928525864|525928|556136|521574|522726|525866|525930|530730|536938|525922|525924|518634|524074|525894|521544|523030|518736|520478|543442
5229531
Sheet5
Cell Formulas
RangeFormula
D2:D4D2=LET(a,TEXTSPLIT(E2,"|"),TOCOL(XLOOKUP($A$2:$A$5&"",a,a),2))
 
Upvote 0

Forum statistics

Threads
1,223,417
Messages
6,171,996
Members
452,438
Latest member
jimmyleung

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