LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sum in hierarchy


Hi, I'm stuck on how to calculate sum within hierarchy. Below is what
I'd like to archive. How can I create a macro that in the end will
WRITE A FORMULA into the cells for every level? For example, at Level
0, the formula is sum all Level1, at level1 = sum all level2 and so on.
The levels are not limited to 4 but will change dynamically.

I'd tried to looking for a start and end row for each level and use it
in a sum formula at the upper level. But I got confuse myself.
Nothing's working. Any ideas are very appreciated.

1. L0 = SUM (ALL L1)
2. --L1 = SUM(ALL L2)
3. ---L2 = SUM (ALL L31)
4. ----L31 = SUM (ALL L41)
5. -----L41 10
6. -----L41 26
7. -----L41 33
8. ----L31 = SUM (ALL L42)
9. -----L42 77
10.-----L42 25
11.-----L42 15
12.---L2 = SUM (ALL L32)
13.----L32 = SUM (ALL L43)
14.-----L43 11
15.-----L43 55
16.----L32 = SUM (ALL L44)
17.-----L44 4
18.-----L44 78

Please help,
hideki


--
hideki
------------------------------------------------------------------------
hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903
View this thread: http://www.excelforum.com/showthread...hreadid=515368

 
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 set up hierarchy in Excel? LailaH Excel Discussion (Misc queries) 2 November 20th 08 05:49 PM
Hierarchy table Derrick Excel Discussion (Misc queries) 1 October 31st 08 01:53 AM
Supervisor Hierarchy Steve C Excel Discussion (Misc queries) 0 July 17th 08 03:34 AM
Hierarchy in excel jamshaggy New Users to Excel 1 July 23rd 06 06:49 PM
SUMPRODUCT - HIERARCHY Matt Brown via OfficeKB.com Excel Worksheet Functions 5 November 6th 04 03:54 AM


All times are GMT +1. The time now is 10:44 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"