Cumulative Total & Percentage

Datatellsall2

New Member
Joined
Jul 17, 2018
Messages
23
Hello -

I'm looking to calculate cumulative totals and percentages based on the type of data in column A (unique company code identifier) and column B (date of time entry). My time data is in column C (formatted as an integer). I would only like to calculate the cumulative total & % if the row data agrees to the unique identifier. I have roughly 5000 lines of data. Should I be utilizing a mix of Vlookup and Sum functions here?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Unique Identifier[/TD]
[TD]Date[/TD]
[TD]Time Amount (hrs)[/TD]
[TD]Cumulative Total[/TD]
[TD]Cumulative %[/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD]1/1/18[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD]1/2/18[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD]1/5/18[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]1/1/18[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]1/9/18[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]1/21/18[/TD]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]1/22/18[/TD]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Any help would be greatly appreciated.

Thanks,
M
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
The pivot table does this unless you absolutely need formulas:


Excel 2010
ABCDEFGHIJKL
1Unique IdentifierDateTime Amount (hrs)Cumulative TotalCumulative %Unique IdentifierDateSum of Time Amount (hrs)Sum of Time Amount (hrs)2Sum of Time Amount (hrs)3
21001/1/201831001/1/2018338.57%
31001/2/201841001/2/20184720.00%
41001/5/201851001/5/201851234.29%
51011/1/201821011/1/2018225.71%
61011/9/201831011/9/20183514.29%
71051/21/2018101051/21/2018101028.57%
81051/22/201881051/22/201881851.43%
Sheet12
 
Last edited:
Upvote 0
like this?

Code:
ID    	Date	       hrs     	Cum. Total
100	1/01/2018	3	3
100	1/02/2018	4	7
100	1/05/2018	5	12
101	1/01/2018	2	2
101	1/09/2018	3	5
105	1/21/2018	10	10
105	1/22/2018	8	18





sorry for the poor formatting i cant seem to get the mrexcel html maker to work for me
this is the formula in the first cell under cumulative total
=C2+IFERROR(LOOKUP(2,1/($A$1:$A1=A2),$D$1:$D1),0)
 
Upvote 0
This works too:


Excel 2010
ABCDE
1Unique IdentifierDateTime Amount (hrs)Cumulative TotalCumulative %
21001/1/2018338.57%
31001/2/20184720.00%
41001/5/201851234.29%
51011/1/2018225.71%
61011/9/20183514.29%
71051/21/2018101028.57%
81051/22/201881851.43%
Sheet12
Cell Formulas
RangeFormula
D2=SUMIF($A$2:A2,A2,$C$2:C2)
E2=D2/SUM($C$2:$C$8)
 
Upvote 0
Thank you! This is almost what I need. The cumulative total formula answers my question for that column. I'm unable to get the right % for cumulative % based on this equation: =D2/SUM($C$2:$C$8), because it doesn't reference my unique identifier. Do I need to add a LOOKUP function to this?

Thanks again,
M
 
Upvote 0
This?


Excel 2010
ABCDE
1Unique IdentifierDateTime Amount (hrs)Cumulative TotalCumulative %
21001/1/20183325.00%
31001/2/20184758.33%
41001/5/2018512100.00%
51011/1/20182240.00%
61011/9/201835100.00%
71051/21/2018101055.56%
81051/22/2018818100.00%
Sheet12
Cell Formulas
RangeFormula
D2=SUMIF($A$2:A2,A2,$C$2:C2)
E2=D2/SUMIF($A$2:$A$8,A2,$C$2:$C$8)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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