#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Combining Rows

I have a spreadsheet where the data I have downloaded went into two rows,
three columns in row 1 and 3 columns in row 2. How can I move the data from
row 2 columns A, B, and C to row 1 columns D, E, and F? I have over 600 of
thse to do, so I wanted to find something automated, so I wouldn't have to
cut and paste each one.

Help!!!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Combining Rows

Assuming you have source data in cols A to C, from row1 down:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
etc

and you want it transformed into 6 cols "pair-wise", ie into:

1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
etc

Just place in D1:
=OFFSET(INDIRECT("A"&ROW(A1)*2-1),INT((COLUMN(A1)-1)/3),MOD(COLUMN(A1)-1,3))
Copy D1 across by 6 cols to I1, then fill down as far as required to exhaust
the source data in cols A to C. This returns the required transformation in
cols D to I. Copy cols D to I & paste special as values elsewhere as desired.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Jim" wrote:
I have a spreadsheet where the data I have downloaded went into two rows,
three columns in row 1 and 3 columns in row 2. How can I move the data from
row 2 columns A, B, and C to row 1 columns D, E, and F? I have over 600 of
thse to do, so I wanted to find something automated, so I wouldn't have to
cut and paste each one.

Help!!!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Combining Rows

Max wrote...
Assuming you have source data in cols A to C, from row1 down:

1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
etc


I'll just assume the data is in a range named D.

and you want it transformed into 6 cols "pair-wise", ie into:

1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
etc

Just place in D1:
=OFFSET(INDIRECT("A"&ROW(A1)*2-1),INT((COLUMN(A1)-1)/3),
MOD(COLUMN(A1)-1,3))


OFFSET and INDIRECT?

Without volatile functions,

D1:
=INDEX(D,2*ROWS(D$1:D1)-
(COLUMNS($D1:D1)<4),MOD(COLUMNS($D1:D1)-1,3)+1)

Fill D1 right into E1:I1, then fill D1:I1 down as far as needed.

But this could be done with simpler formulas and an autofilter. Enter
the formula =A2 in cell D1 and fill D1 right into E1:F1. Enter the
formula =MOD(ROWS(G$1:G1),2) in cell G1. Select D1:G1 and double click
on the fill handle (the box at the bottom right corner of the border
around the selected range). Assuming this filled D1:G1 down into
D2:G700, D1:G700 should now be the selected range. Run the menu
commands Edit Copy then Edit Paste Special as values. Then select
A1:G700, run the menu command Data Filter AutoFilter, filter
column G for value 0, delete the filtered rows from row *2* down,
clear the autofilter by running the menu command Data Filter
AutoFilter again, and clear the range of 1s in column G.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default Combining Rows

This could be done without any formulas:
Select cells plus top blank row.
Format AutoFormat List1
Options Uncheck all except Pattern
Edit Find Options Format Choose Format from Cell
Select any white cell Find All SHIFT+END Close

Insert Shift cells right
Select all
Edit Go To Special Blanks
Delete Shift cells up

This assumes there are no blanks in the data.
A certain row limit exists.(Why?)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Combining Rows

"Herbert Seidenberg" wrote...
This could be done without any formulas:
Select cells plus top blank row.

....

So OP may need to insert a blank row above the data.

Edit Find Options Format Choose Format from Cell
Select any white cell Find All SHIFT+END Close

....

This requires Excel 2003, doesn't it?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Combining Rows

Data|List was added in xl2003. (But the Format|autoformat has been there pretty
long, IIRC.)

The enhancement to Edit|Find based on format was added in xl2002.



Harlan Grove wrote:

"Herbert Seidenberg" wrote...
This could be done without any formulas:
Select cells plus top blank row.

...

So OP may need to insert a blank row above the data.

Edit Find Options Format Choose Format from Cell
Select any white cell Find All SHIFT+END Close

...

This requires Excel 2003, doesn't it?


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default Combining Rows

If blanks or row limits are a problem,
here is an alternate procedu
Select cells plus top blank row
Format AutoFormat List1
Options Uncheck all except Pattern
Edit Find Options Format Choose Format from Cell
Select any white cell Find All SHIFT+END Close

Copy Paste to the right of data, up 1 row
Select left half of data
Find Find All SHIFT+END Close
Delete Shift cells up


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Combining Rows

Dave Peterson wrote...
....
The enhancement to Edit|Find based on format was added in xl2002.

....

Thanks for that. 2002 was the one version I didn't use for any
appreciable period.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining rows of like data? Juggernaut Excel Worksheet Functions 6 September 19th 06 03:03 AM
Combining Information from rows Terrell Excel Discussion (Misc queries) 9 February 11th 06 09:41 AM
Sorting & Combining Rows LaNaye Excel Discussion (Misc queries) 3 January 12th 06 02:14 PM
VB Error, combining rows if... savvysam Excel Worksheet Functions 1 August 24th 05 10:58 PM
Combining rows SteveRJ Excel Worksheet Functions 1 June 17th 05 01:02 PM


All times are GMT +1. The time now is 04:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"