Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jezzica85
 
Posts: n/a
Default combining duplicate rows

Hi all,
Does anyone know if there's a way to turn something like this:
I M R SUM
2 7 1 10
a 2 2
a 3 3
b 1 1
c 4 4

into this:

I M R SUM
2 7 1 10
a 2 3 0 5
b 0 0 1 1
c 0 4 0 4

I, M, R are column headers, and a, b, and c are data. Just below the column
headers is the sum for all the rest of the values in the column. I'm not
very good at macros, so if the solution is a macro would you mind telling me
how to implement it?
Thanks so much!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default combining duplicate rows

If your data is nicely sorted by column A, you could use:

Data|subtotals and sum each column based on the change in column A.

After you do that, you'll see outlining symbols to the left of the worksheet.
You can use those to hide/show the details.

Another option is to learn a bit about pivottables.
(add headers to any column that doesn't have one)

Select your data (headerrow through bottom right cell)
Data|pivototable
follow the wizard until you get to a step that has a Layout button on it.
Hit that layout button
drag the heaeder for the category to the row field
drag the header for I to the data field
(Double click on that and make sure it says "Sum of" instead of "count of")

do the same with the other column headers

Finish up that wizard.

Now drag the grey cell with Data in it directly to its right and let go.
(right on top of the cell with Total in it)

Now right click anywhere in that pivottable and choose "table options"
Make sure that "for empty cells, show" box is checked and choose 0 as the
character to show (if you really want to see 0's.)


jezzica85 wrote:

Hi all,
Does anyone know if there's a way to turn something like this:
I M R SUM
2 7 1 10
a 2 2
a 3 3
b 1 1
c 4 4

into this:

I M R SUM
2 7 1 10
a 2 3 0 5
b 0 0 1 1
c 0 4 0 4

I, M, R are column headers, and a, b, and c are data. Just below the column
headers is the sum for all the rest of the values in the column. I'm not
very good at macros, so if the solution is a macro would you mind telling me
how to implement it?
Thanks so much!


--

Dave Peterson
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
How do I remove Duplicate rows? 85225 Excel Discussion (Misc queries) 15 March 9th 07 11:41 PM
Count on multiple values with duplicate rows Carla Excel Worksheet Functions 1 November 22nd 05 09:25 PM
Combining rows SteveRJ Excel Worksheet Functions 1 June 17th 05 01:02 PM
Find duplicate rows and add together DaleM Excel Discussion (Misc queries) 1 February 9th 05 12:53 AM
Showing Duplicate rows in excel Jagz Excel Discussion (Misc queries) 3 January 1st 05 10:57 AM


All times are GMT +1. The time now is 03:50 PM.

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

About Us

"It's about Microsoft Excel"