View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mmccoog mmccoog is offline
external usenet poster
 
Posts: 15
Default Excel - Calculating quantities in a hierarchy

Thank you Sheeloo. That was extremely helpful. The first example was exactly
what I was looking for. The only problem is, I want the sum function to stop
when it hits a level that is equal or higher than the level on the current
line. Is that possible?

"Sheeloo" wrote:

Your question is not clear, however
Assuming your Levels are in Col A, indicated by 1,2,3,4
Col B indicates whether it is a cost by "C" and Sum by "S"
and you have acutal values in Col C,
then you can sum up cost at a given level
=SUMPRODUCT(--(A1:A100=D1),--(B1:B100="C"),(C1:C100))

where D1 contains the level (1,2 ,3 or 4)

If you want to sum level 3 AND 4 then you can have
=SUMPRODUCT(--(A1:A100D1),--(B1:B100="C"),(C1:C100))
with D2 having the value 2


"mmccoog" wrote:

Hello,
I have a rather complex question but limited experience with excel. I have a
family tree type of file and need to calculate costs based on the lower level
costs.
Example:
Level 1 AAAA sum of levels 2 ($17)
Level 2 BBBB $5
Level 2 CCCC sum of levels 3 ($12)
Level 3 DDD sum of level 4 ($5)
Level 4 EEE $5
Level 3 FFF $7

Each record has the level code and an indicator to tell if it's a sum or if
it has the cost. I'm able to do this manually but the files can become large
and this takes a while to process, level by level. Hopefully this make sense
and there's an easy way to do this.