Extract String

billandrew

Well-known Member
Joined
Mar 9, 2014
Messages
743
Good morning

Trying to extract a string of numbers, could be up to 20 values which are separated by a column into individual cells in same row. Formula would be beneficial.

Example

1, 2, 3, - export as 1 2 3 separated.

Thank you
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Excel 2010
ABCDEFGH
131, 2, 3, 4, 5, 6, 71234567
extract
Cell Formulas
RangeFormula
B13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
C13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
D13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
E13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
F13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
G13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
H13=IF(TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$A13,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
 
Upvote 0
My data is in a diiferent cell. When I adjust, nothing is returned.
It would have helped if you had told us what cell your data started in. Since you didn't, I'll assume cell E11... this formula in cell F11 and copy it across for as many cells as you think you will ever have data for, then copy those down to the bottom of your data...

=TRIM(MID(SUBSTITUTE(","&SUBSTITUTE($E11," ",""),",",REPT(" ",99)),COLUMNS($F:F)*99,99))

NOTE 1: I am assuming none of your cells will contain more than 99 characters

NOTE 2: Change the column references (highlighted in red) to the column you put the formula in.
 
Upvote 0
Can you post a sample of your data and the exact formula you used.
 
Upvote 0
The cell with the data is AI5. Currently looks like 1, 2, 5, 6

The formula is - =IF(TRIM(MID(SUBSTITUTE(","&$AI5,",",REPT(" ",200)),200*(COLUMN()-1),200))<>"",TRIM(MID(SUBSTITUTE(","&$AI5,",",REPT(" ",200)),200*(COLUMN()-1),200))+0,"")
 
Upvote 0
Mr. Rothstein

Adjusted to my cell references, works perfect.

I don't entirely understand how it works though.....

Thank You
 
Upvote 0
Hi,

Try this:


Excel 2010
AIAJAKALAMANAOAPAQARAS
51, 2, 3, 4, 5, 6, 7, 8, 9, 1012345678910
Sheet6
Cell Formulas
RangeFormula
AJ5=IFERROR(MID(SUBSTITUTE(","&$AI5,",",REPT(" ",100)),COLUMNS($B:B)*100,100)+0,"")


Formula copied across as needed, use formula as is.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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