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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

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,215,575
Messages
6,125,629
Members
449,241
Latest member
NoniJ

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