Roll-up sum

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,364
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
As you can see in column A, there is a level in this hierarchy structure. I would like to see a roll-up sum in columns H:K.

In columns D:G, I've already have the sum for the associated "Dept", but struggling with how to get the sums for any roll-ups past level 2.

For level 2 I used =IF(LEFT($B3,7)<>LEFT($B4,7),SUMPRODUCT(--(LEFT($B$4:$B$52,7)=LEFT($B4,7)),--(D$4:D$52)),"")

Struggling with row 6, 20, and 25. I've used Sumproduct because I'm putting this in VBA code and the workbook I'll be referencing is closed. This is to test the process/formula.

Unfourtunately because of work restrictions, I can only post the image.

1687980804325.png
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Here is a range versus an image. Just trying to make a roll-up for those dependent to an upper level as seen in column A.

Book1.xlsx
ABCDEFGHIJKL
1LevelDeptParent Dept
2C10128B3545ABCTOTALABCTOTAL
31C101280000C10128328741160
42C101281000C101280000110415
53C101281100C10128100044    
63C101281200C101281000221629Needed
74C101281210C101281200167
83C101281300C10128100022    
92C101282000C101280000 6410
103C101282100C10128200033    
113C101282200C10128200022    
123C101282210C10128200011    
133C101282300C10128200022    
143C101282400C101282000112    
152C101284000C10128000028818
163C101284100C10128400044    
173C101284200C10128400026412    
183C101284300C10128400022    
192C101285000C101280000296325117
203C101285100C101285000210214720936Needed
214C101285110C1012851003317
224C101285150C1012851001135
234C101285160C1012851001629
244C101285170C10128510011
253C101285200C10128500022431681Needed
264C10128522BC1012852001026844
274C10128522AC1012852003429
284C101285220C101285200
294C101285240C10128520022
304C1012852L0C101285200511521
314C1012852M0C101285200112
324C1012852N0C10128520033
Org Chart Data
Cell Formulas
RangeFormula
D3:G3D3=SUM(D4:D32)
H8:K19,H4:K5H4=IF(LEFT($B3,7)<>LEFT($B4,7),SUMPRODUCT(--(LEFT($B$4:$B$32,7)=LEFT($B4,7)),--(D$4:D$32)),"")
H6:K6H6=SUM(D6:D7)
H20:K20H20=SUM(D20:D24)
H25:K25H25=SUM(D26:D32)
 
Upvote 0

Forum statistics

Threads
1,215,092
Messages
6,123,064
Members
449,090
Latest member
fragment

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top