Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping Rows in Excel 2010 1

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,503
US

Let’s say I have this data in rows 6-16

[pre]
6 Project Number One
7 Event 1
8 Detail 1
9 Detail 2
10 Detail 3
11 Event 2
12 Detail 1
13 Detail 2
14 Detail 3
15 Detail 4
16 Project Number Two
[/pre]
No TOTAL row, just the data you see.

I would like to have one Group for every Project Number (rows 7-15) and (sub)group for every Event (rows 8-10 and rows 12-15)

I can select rows 7-15, and click (in Outline) Group. That nicely groups the selected rows for 'Project Number One'. The I can select rows 8-10, click Group again and I have a nice group for 'Event 1'.

Now, if I do the same for 'Event 2': select rows 12-15 and click Group, Excel does not group these rows. :-(

I can make it work if I have an empty row between ‘Detail 4’ (row 15) and ‘Project Number Two’ (row 16), but how can I do it with the data I have?


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Andy, I'm just guessing here, but I think you have part of a PivotTable report.

I normalized your data...
[pre]
Project Event Detail

Project Number One Event 1 Detail 1
Project Number One Event 1 Detail 2
Project Number One Event 1 Detail 3
Project Number One Event 2 Detail 1
Project Number One Event 2 Detail 2
Project Number One Event 2 Detail 3
Project Number One Event 2 Detail 4
[/pre]

...and then did a pivot (non-classical display)
[pre]
Row Labels
[highlight #888A85]-[/highlight]Project Number One
[highlight #888A85]-[/highlight]Event 1

Detail 1
Detail 2
Detail 3
[highlight #888A85]-[/highlight]Event 2

Detail 1
Detail 2
Detail 3
Detail 4
[/pre]

If YOU did the pivot from the source data, you'd have groups.
[pre]
Row Labels
[highlight #888A85]-[/highlight]Project Number One
[highlight #888A85]+[/highlight]Event 1
[highlight #888A85]+[/highlight]Event 2


[/pre]
What are you attempting to accomplish, other than what you stated??
 
Pivot table is a good guess, but sadly – no, that’s not what I start with (maybe I should…). What I have is the data in Oracle and the example I show is just the report in Excel (which I (try to) create with a VB6 application). Sometimes users want me to create reports that would group some rows like the one above.

But I could create the normalized data sheet, like you showed, and create a pivot table out of it. Users don’t care how I get the data as long as they get what they want. :)

Thanks Skip.


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
If you have data in Oracle, no need to normalize the example. Either query Oracle to return data to a sheet and then pivot fron that sheet/table or start the wizard and use External to access Oracle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top