Split Text by Deliminator - Dynamic text

flatterno

New Member
Joined
Mar 24, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi!

I have a table with two columns, headed Name and Jobs range A1:B28 (which is fixed).

Column B contains the jobs that each person in column A will perform separated by a comma. This is a dynamically filled column, with the data pulled from various cells on other cells. Each cell in B contains a formula ='Matrix'!CK33 to ='Cast Matrix'!CK60 etc.

Everyone will have a maximum of 6 jobs each

All I am trying to do is split the jobs up into the following columns (C:H) with some cells empty if people have fewer than 6 jobs).

Text to columns doesn't work as firstly all it sees is the formula in the cell, but also it won't update dynamically.

This table is never updated itself, the updates occur in the worksheet named Matrix, I just want this sheet as a report almost

Any help appreciated
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Can you post a sample of your data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
paulwash
simonwalk the dog, clean the windows
clairehoover, put out the bins, ironing
hilaryshopping
trevorplanning food
abigailrest
ryanprepare food
williamexercise, mop floors

That's a sample of my original

And this is what I would like to achieve

wash
walk the dogclean the windows
hooverput out the binsironing
shopping
planning food
rest
prepare food
exercisemop floors
 
Upvote 0
OK, two options, one will only work on a PC
+Fluff 1.xlsm
ABCDEFGHI
1PC onlyPC or Mac
2paulwashwashwash
3simonwalk the dog, clean the windowswalk the dogclean the windowswalk the dogclean the windows
4clairehoover, put out the bins, ironinghooverput out the binsironinghooverput out the binsironing
5hilaryshoppingshoppingshopping
6trevorplanning foodplanning foodplanning food
7abigailrestrestrest
8ryanprepare foodprepare foodprepare food
9williamexercise, mop floorsexercisemop floorsexercisemop floors
10
Main
Cell Formulas
RangeFormula
C2,C5:C8,C9:D9,C4:E4,C3:D3C2=TRANSPOSE(FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE(B2,",","</m><m>"),"&","&amp;")&"</m></k>","//m"))
G2,G5:G8,G9:H9,G4:I4,G3:H3G2=LET(Txt,","&B2&",",Qty,SEQUENCE((LEN(Txt)-LEN(SUBSTITUTE(Txt,",","")))-1),TRANSPOSE(TRIM(REPLACE(LEFT(Txt,FIND("~",SUBSTITUTE(Txt,",","~",Qty+1))-1),1,FIND("~",SUBSTITUTE(Txt,",","~",Qty)),""))))
 
Upvote 0
Hi,

Also try this, drag as far down and across as needed, don't know if it works on Mac, let us know:

Book3.xlsx
ABCDEF
1paulwashwash   
2simonwalk the dog, clean the windowswalk the dogclean the windows  
3clairehoover, put out the bins, ironinghooverput out the binsironing 
4hilaryshoppingshopping   
5trevorplanning foodplanning food   
6abigailrestrest   
7ryanprepare foodprepare food   
8williamexercise, mop floorsexercisemop floors  
Sheet873
Cell Formulas
RangeFormula
C1:F8C1=TRIM(MID(SUBSTITUTE(","&$B1,",",REPT(" ",100)),COLUMNS($C1:C1)*100,100))
 
Upvote 1
Hi,

Also try this, drag as far down and across as needed, don't know if it works on Mac, let us know:

Book3.xlsx
ABCDEF
1paulwashwash   
2simonwalk the dog, clean the windowswalk the dogclean the windows  
3clairehoover, put out the bins, ironinghooverput out the binsironing 
4hilaryshoppingshopping   
5trevorplanning foodplanning food   
6abigailrestrest   
7ryanprepare foodprepare food   
8williamexercise, mop floorsexercisemop floors  
Sheet873
Cell Formulas
RangeFormula
C1:F8C1=TRIM(MID(SUBSTITUTE(","&$B1,",",REPT(" ",100)),COLUMNS($C1:C1)*100,100))

Hello jtakw,

I asked this type of question earlier but still in this formula I am not getting it
can you please explain =SUBSTITUTE(","&$B1,",",REPT(" ",100) what is purpose of ","&B1 and not only B1?
 
Upvote 0
Hello jtakw,

can you please explain =SUBSTITUTE(","&$B1,",",REPT(" ",100) what is purpose of ","&B1 and not only B1?

As you probably already know, the MID part of the formula is extracting partial text from the text string, using SUBSTITUTE for the comma (",") for 100 Spaces.
By adding ","&B1, using the COLUMNS, extraction Starts at 100, at 100 intervals per column to the right.

Another way to write the formula Without ","&B1 would be:

=TRIM(MID(SUBSTITUTE($B2,",",REPT(" ",100)),COLUMNS($C2:C2)*100-99,100))

Notice instead of ","&B1, we subtracted 99 from 100, so now the extraction Starts at 1, adding 100 to each interval.

Results are the same, either way.
 
Upvote 1
As you probably already know, the MID part of the formula is extracting partial text from the text string, using SUBSTITUTE for the comma (",") for 100 Spaces.
By adding ","&B1, using the COLUMNS, extraction Starts at 100, at 100 intervals per column to the right.

Another way to write the formula Without ","&B1 would be:

=TRIM(MID(SUBSTITUTE($B2,",",REPT(" ",100)),COLUMNS($C2:C2)*100-99,100))

Notice instead of ","&B1, we subtracted 99 from 100, so now the extraction Starts at 1, adding 100 to each interval.

Results are the same, either way.
Thank you very mcuh jtakw
.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,595
Members
449,089
Latest member
Motoracer88

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