Sum Subtotals Based on numbered subsections

sameri

New Member
Joined
May 15, 2024
Messages
7
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
Hi All!

First time post so hopefully I get ti right!

I've tried a few methods but finding myself getting stuck. I need to be able to dynamically sum values based on subsection numbering.

Note:
  • The numbers shown in column A are static pasted values from another export.
  • The formulas in columns S, T and U all need to be dynamic as this sheet is hopefully going to be used a template. i.e. simply entering a heap of SUM formulas into the relevant cells won't suffice nor will manually grouping cells and adding a Subtotals as theses are all manual actions after pasting the data in.
  • Note that all of the colored formatting shown is dynamic Conditional Formatting based on comparing the LEN row x with x+1 in Column A - this won't work for my purposes as there are obviously nested subsections in column A.
  • Trying to achieve this without VBA as we are attempting to keep the workbook without macros/scripts.
  • Examples of what I'm trying to achieve:
    • In cell U25, show the sum of all 4.4.1 items, i.e. U29+U34.
    • In cell U34, show the sum of all 4.4.1.5 items, i.e. U35+U48
    • In cell U35, show the sum of all 4.4.1.5.1 items, i.e. SUM(U36:U47)

1715821283448.png
 
How did you get from the previously posted formulas to that one ?
It doesn't work.
The following are incorrect:

1715841207191.png


20240516 SumIfs sameri.xlsx
ABCDEFG
1TASKPer LineSubsFinal S/BeOPs FinalDifference
2(Hidden)(Hidden)
34$98,658$98,658$364,438-$265,780
44.1$35,136$35,136$35,136$0
54.1.1$16,652$0$16,652$16,652$0
64.1.2$16,494$0$16,494$16,494$0
74.1.3$1,990$0$1,990$1,990$0
84.2$9,988$9,988$9,988$0
94.2.1$6,644$0$6,644$6,644$0
104.2.2$3,344$3,344$3,344$0
114.2.2.1$704$0$704$704$0
124.2.2.2$2,640$0$2,640$2,640$0
134.3$3,344$3,344$3,344$0
144.3.1$3,344$3,344$3,344$0
154.3.1.1$704$0$704$704$0
164.3.1.2$1,408$0$1,408$1,408$0
174.3.1.3$1,232$0$1,232$1,232$0
184.4$50,190$50,190$264,358-$214,168
194.4.1$50,190$50,190$114,342-$64,152
204.4.1.1$14,080$0$14,080$14,080$0
214.4.1.2$2,846$0$2,846$2,846$0
224.4.1.3$2,816$0$2,816$2,816$0
234.4.1.4$15,488$15,488$15,488$0
244.4.1.4.1$2,112$0$2,112$2,112$0
254.4.1.4.2$4,928$0$4,928$4,928$0
264.4.1.4.3$5,632$0$5,632$5,632$0
274.4.1.4.4$2,816$0$2,816$2,816$0
284.4.1.5$14,960$14,960$21,120-$6,160
294.4.1.5.1$14,960$14,960$14,960$0
304.4.1.5.1.1$3,432$0$3,432$3,432$0
314.4.1.5.1.2$0$0$0
324.4.1.5.1.3$1,408$0$1,408$1,408$0
334.4.1.5.1.4$1,408$0$1,408$1,408$0
344.4.1.5.1.5$880$0$880$880$0
354.4.1.5.1.6$3,696$0$3,696$3,696$0
364.4.1.5.1.7$704$0$704$704$0
374.4.1.5.1.8$440$0$440$440$0
384.4.1.5.1.9$704$0$704$704$0
394.4.1.5.1.10$1,056$0$1,056$1,056$0
404.4.1.5.1.11$528$0$528$528$0
414.4.1.5.1.12$704$0$704$704$0
Sheet2
Cell Formulas
RangeFormula
C3:C41C3=SUM(SUMIFS(B:B,A:A,A3&{".?",".??"})+SUMIFS(C:C,A:A,A3&{".?",".??"}))
D3:D41D3=B3+C3
G3:G41G3=D3-F3
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet2!$A$2:$G$41C3:C41
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How did you get from the previously posted formulas to that one ?
It doesn't work.
The following are incorrect:

View attachment 111490

20240516 SumIfs sameri.xlsx
ABCDEFG
1TASKPer LineSubsFinal S/BeOPs FinalDifference
2(Hidden)(Hidden)
34$98,658$98,658$364,438-$265,780
44.1$35,136$35,136$35,136$0
54.1.1$16,652$0$16,652$16,652$0
64.1.2$16,494$0$16,494$16,494$0
74.1.3$1,990$0$1,990$1,990$0
84.2$9,988$9,988$9,988$0
94.2.1$6,644$0$6,644$6,644$0
104.2.2$3,344$3,344$3,344$0
114.2.2.1$704$0$704$704$0
124.2.2.2$2,640$0$2,640$2,640$0
134.3$3,344$3,344$3,344$0
144.3.1$3,344$3,344$3,344$0
154.3.1.1$704$0$704$704$0
164.3.1.2$1,408$0$1,408$1,408$0
174.3.1.3$1,232$0$1,232$1,232$0
184.4$50,190$50,190$264,358-$214,168
194.4.1$50,190$50,190$114,342-$64,152
204.4.1.1$14,080$0$14,080$14,080$0
214.4.1.2$2,846$0$2,846$2,846$0
224.4.1.3$2,816$0$2,816$2,816$0
234.4.1.4$15,488$15,488$15,488$0
244.4.1.4.1$2,112$0$2,112$2,112$0
254.4.1.4.2$4,928$0$4,928$4,928$0
264.4.1.4.3$5,632$0$5,632$5,632$0
274.4.1.4.4$2,816$0$2,816$2,816$0
284.4.1.5$14,960$14,960$21,120-$6,160
294.4.1.5.1$14,960$14,960$14,960$0
304.4.1.5.1.1$3,432$0$3,432$3,432$0
314.4.1.5.1.2$0$0$0
324.4.1.5.1.3$1,408$0$1,408$1,408$0
334.4.1.5.1.4$1,408$0$1,408$1,408$0
344.4.1.5.1.5$880$0$880$880$0
354.4.1.5.1.6$3,696$0$3,696$3,696$0
364.4.1.5.1.7$704$0$704$704$0
374.4.1.5.1.8$440$0$440$440$0
384.4.1.5.1.9$704$0$704$704$0
394.4.1.5.1.10$1,056$0$1,056$1,056$0
404.4.1.5.1.11$528$0$528$528$0
414.4.1.5.1.12$704$0$704$704$0
Sheet2
Cell Formulas
RangeFormula
C3:C41C3=SUM(SUMIFS(B:B,A:A,A3&{".?",".??"})+SUMIFS(C:C,A:A,A3&{".?",".??"}))
D3:D41D3=B3+C3
G3:G41G3=D3-F3
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet2!$A$2:$G$41C3:C41
I am royally screwing up my first post here aren't I! I ommitted a heap of data in my snippet. I just got excited that it was working....

Let me try again:

IDPer Line
(Hidden)
Subs
(Hidden)
Estimated Final Cost
4$ 364,438$ 909,500$ 364,438
4.1$ -$ 35,136$ 35,136
4.1.1$ 16,652$ -$ 16,652
4.1.2$ 16,494$ -$ 16,494
4.1.3$ 1,990$ -$ 1,990
4.2$ -$ 9,988$ 9,988
4.2.1$ 6,644$ -$ 6,644
4.2.2$ -$ 3,344$ 3,344
4.2.2.1$ 704$ -$ 704
4.2.2.2$ 2,640$ -$ 2,640
4.3$ -$ 3,344$ 3,344
4.3.1$ -$ 3,344$ 3,344
4.3.1.1$ 704$ -$ 704
4.3.1.2$ 1,408$ -$ 1,408
4.3.1.3$ 1,232$ -$ 1,232
4.4$ -$ 264,358$ 264,358
4.4.1$ -$ 114,342$ 114,342
4.4.1.1$ 14,080$ -$ 14,080
4.4.1.2$ 2,846$ -$ 2,846
4.4.1.3$ 2,816$ -$ 2,816
4.4.1.4$ -$ 15,488$ 15,488
4.4.1.4.1$ 2,112$ -$ 2,112
4.4.1.4.2$ 4,928$ -$ 4,928
4.4.1.4.3$ 5,632$ -$ 5,632
4.4.1.4.4$ 2,816$ -$ 2,816
4.4.1.5$ -$ 21,120$ 21,120
4.4.1.5.1$ -$ 14,960$ 14,960
4.4.1.5.1.1$ 3,432$ -$ 3,432
4.4.1.5.1.2$ -$ -$ -
4.4.1.5.1.3$ 1,408$ -$ 1,408
4.4.1.5.1.4$ 1,408$ -$ 1,408
4.4.1.5.1.5$ 880$ -$ 880
4.4.1.5.1.6$ 3,696$ -$ 3,696
4.4.1.5.1.7$ 704$ -$ 704
4.4.1.5.1.8$ 440$ -$ 440
4.4.1.5.1.9$ 704$ -$ 704
4.4.1.5.1.10$ 1,056$ -$ 1,056
4.4.1.5.1.11$ 528$ -$ 528
4.4.1.5.1.12$ 704$ -$ 704
4.4.1.5.2$ -$ 6,160$ 6,160
4.4.1.5.2.1$ 1,584$ -$ 1,584
4.4.1.5.2.2$ -$ -$ -
4.4.1.5.2.3$ 264$ -$ 264
4.4.1.5.2.4$ 264$ -$ 264
4.4.1.5.2.5$ 264$ -$ 264
4.4.1.5.2.6$ 2,112$ -$ 2,112
4.4.1.5.2.7$ 264$ -$ 264
4.4.1.5.2.8$ 264$ -$ 264
4.4.1.5.2.9$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4.1.8.2.7$ 704$ -$ 704
4.4.2$ -$ 150,016$ 150,016
4.4.2.1$ 6,336$ -$ 6,336
4.4.2.2$ 25,952$ -$ 25,952
4.4.2.3$ 2,816$ -$ 2,816
4.4.2.4$ 1,760$ -$ 1,760
4.4.2.5$ -$ 73,728$ 73,728
4.4.2.5.1$ 14,080$ -$ 14,080
4.4.2.5.2$ 16,448$ -$ 16,448
4.4.2.5.3$ 15,744$ -$ 15,744
4.4.2.5.4$ 11,264$ -$ 11,264
4.4.2.5.5$ 10,560$ -$ 10,560
4.4.2.5.6$ 5,632$ -$ 5,632
4.4.2.6$ 15,488$ -$ 15,488
4.4.2.7$ 4,224$ -$ 4,224
4.4.2.8$ 16,896$ -$ 16,896
4.4.2.9$ 2,112$ -$ 2,112
4.4.2.10$ 704$ -$ 704
4.5$ -$ 51,612$ 51,612
4.5.1$ 7,436$ -$ 7,436
4.5.2$ 10,560$ -$ 10,560
4.5.3$ 7,040$ -$ 7,040
4.5.4$ -$ 26,576$ 26,576
4.5.4.1$ 5,632$ -$ 5,632
4.5.4.2$ 12,672$ -$ 12,672
4.5.4.3$ 2,816$ -$ 2,816
4.5.4.4$ 880$ -$ 880
4.5.4.5$ 4,224$ -$ 4,224
4.5.4.6$ 352$ -$ 352
 
Upvote 0

Forum statistics

Threads
1,223,872
Messages
6,175,104
Members
452,613
Latest member
amorehouse

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