View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Radrays Radrays is offline
external usenet poster
 
Posts: 14
Default Convert text to rows

Glenn I am still struggling with this one...you mentioned a possible easy
macro?

"Glenn" wrote:

Probably an easy macro solution to this, but here is a way using worksheet
formulas. Assuming your data is in A2:L20000, and that the rest of the sheet is
empty, and that the "numbers" in column G are always in the format of "five
digits <space three digits", enter the number 1 in M2 and then the following
array formula (commit with CTRL+SHIFT+ENTER) in M3 and copy down:

=SUM((LEN(TRIM($G$2:G2))-LEN(SUBSTITUTE(TRIM($G$2:G2)," ",""))-1)/2+1)+1

Then add the following:

N2 =MATCH(ROW(A1),M:M,1)-1
O2 =INDEX($A$2:$L$6,$N2,COLUMN(A1))

Copy N2 down and O2 down and across to column Z.

Change U2 as follows and copy down:

=MID(SUBSTITUTE(" "&INDEX($A$2:$L$6,$N2,
COLUMN(G1))&" "," ","@",COUNTIF($N$2:N2,N2)*2-1),
FIND("@",SUBSTITUTE(" "&INDEX($A$2:$L$6,$N2,
COLUMN(G1))&" "," ","@",COUNTIF($N$2:N2,N2)*2-1))+1,9)


Radrays wrote:
The numbers are in a sequence such as "89051 001 89060 001" whereas each
number 8 begins a new number. Some cells will have just 1 set of numbers
(89051 001) others may have as many as 6 sets of numbers.

"Mike H" wrote:

Hi,

Not enough information.
Is (for example) 21 one number or 2
are the numbers delimited in any way

Mike


"Radrays" wrote:

I am currently using 2007 - I have about 20,000 rows by 12 columns of
information in a spreadsheet.

Column "G" cells will at times have more than 1 number in it.
How can I split the cell so each number within that cell is in it's own row?

Thank you.

.