Use of TextSplit Function to a cell with multiple text line separated by delimiter

nsa1

New Member
Joined
Jul 11, 2023
Messages
39
Office Version
  1. 2010
Hello,

I have a situation where I want to get number assigned to each name to be printed next to a cell input with multiple names separated by carriage return. ie in my attached example, Group column (Col A) with the formula should find Alex, Brandon, Joe ect from Col E...pick up their number from Col D and print in A2 = 1, 2, 3 and in A3 = 5,6

Thanks in advance!

NA
 

Attachments

  • Textsplit.png
    Textsplit.png
    49.2 KB · Views: 20

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Is this what you mean?

BTW, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

23 08 29.xlsm
ABCDE
11 2 3Alex Brandon Joe
24 5Alan Curtis1Alex
32Brandon
43Joe
54Alan
65Curtis
nsa1
Cell Formulas
RangeFormula
A1:A2A1=TEXTJOIN(CHAR(10),,XLOOKUP(TEXTSPLIT(B1,CHAR(10)),E$2:E$6,D$2:D$6))
 
Upvote 0
=TEXTJOIN(CHAR(10),,XLOOKUP(TEXTSPLIT(B1,CHAR(10)),E$2:E$6,D$2:D$6))
Thanks Peter!

I am not getting 123 instead of 1 Cr 2 Cr 3 like yours...why? I don't know how to insert this as a file here. They only have upload image?
 
Upvote 0
I'm pretty sure that's just a matter of having wrap text enabled?
 
Upvote 1
Solution
Glad to have helped, but probably don't mark my reply as the solution, since it doesn't solve your actual problem but just clarifies the solution by Peter.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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