Is this the best way to generate a cumulative column in a table?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,676
Office Version
  1. 365
Platform
  1. Windows
I need a cumulative column in a table that will survive adding, deleting, moving, and sorting rows. This is what I came up with. Is it the best way? It works, but it seems inefficient.

Typing Tutor Adaptive Learning Algorithm.xlsm
IJ
5ProbCum Prob
610.00%10.00%
720.00%30.00%
830.00%60.00%
940.00%100.00%
10100.00%
Weighted Drills 03
Cell Formulas
RangeFormula
J6:J9J6=SUM(OFFSET(Table10[[#Headers],[Prob]],1,0):Table10[@Prob])
I10I10=SUBTOTAL(109,[Prob])
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi, see the linked file for a possible solution...

The formulas used in the table:
A1: =IF(INDEX(Work!I:I,ROW())="","",INDEX(Work!I:I,ROW()))
B2: =IF(A2="","",SUM(A$2:A2))
C2: =SUM(A:A)

Sum.xlsx
 
Upvote 0
I tend to use
Fluff.xlsm
IJ
5ProbCum Prob
610%10%
720%30%
830%60%
940%100%
Main
Cell Formulas
RangeFormula
J6:J9J6=SUM(Table2[[#Headers],[Prob]]:[@Prob])
 
Upvote 0
Solution
I tend to use . . .
That's much better. So the syntax =TableName[[#Headers],[ColumnName]] means "the top of the column" or "the first data member"?

Very nice and much cleaner than my method. Thanks
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Another option to consider
T202302.xlsm
ABC
1ProbCum ProbOr
210%10%10%
320%30%30%
440%70%70%
5
2c
Cell Formulas
RangeFormula
B2:B4B2=SUM(Table2[[#Headers],[Prob]]:[@Prob])
C2:C4C2=SUM(INDEX([Prob],1):[@Prob])
 
Upvote 0
Another option to consider . . .
Great, very helpful.

Here's a little sheet with a table showing the various options.

Cell Formulas
RangeFormula
D5:D11D5=[@Weight]/TblCum[[#Totals],[Weight]]
E5:E11E5=SUM(OFFSET(TblCum[[#Headers],[Prob]],1,0):[@Prob])
F5:F11F5=SUM(TblCum[[#Headers],[Prob]]:[@Prob])
G5:G11G5=TblCum[[#Headers],[Prob]]
H5:H11H5=SUM(INDEX([Prob],1):[@Prob])
I5:I11I5=INDEX([Prob],1)
C12C12=SUBTOTAL(109,[Weight])
D12D12=SUBTOTAL(109,[Prob])


And here is the same table sorted on the Weight column to illustrate that the cumulative columns still work properly.

Cell Formulas
RangeFormula
D5:D11D5=[@Weight]/TblCum[[#Totals],[Weight]]
E5:E11E5=SUM(OFFSET(TblCum[[#Headers],[Prob]],1,0):[@Prob])
F5:F11F5=SUM(TblCum[[#Headers],[Prob]]:[@Prob])
G5:G11G5=TblCum[[#Headers],[Prob]]
H5:H11H5=SUM(INDEX([Prob],1):[@Prob])
I5:I11I5=INDEX([Prob],1)
C12C12=SUBTOTAL(109,[Weight])
D12D12=SUBTOTAL(109,[Prob])
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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