Forum

Notifications
Clear all

Cumulative sum over time by group

4 Posts
2 Users
0 Reactions
157 Views
(@brunomelki)
Posts: 46
Trusted Member
Topic starter
 

Hello

I have list of data (numbers) over time (days) for several groups. I need to calculate the cummulative data of each group by time for every day. In mpython, I get the result that way after sorting it:

data_sorted['cum'] = data_sorted.groupby(['group'])['data'].cumsum()

 

How can I get it in excel. Didn't succeed to overcome the long list

Thanks

 
Posted : 21/04/2020 4:11 am
(@brunomelki)
Posts: 46
Trusted Member
Topic starter
 

Untitled.jpg

 
Posted : 21/04/2020 4:13 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Bruno,

Sounds like a job for a pivot table. Please supply your workbook with the data.

Regards

Phil

 
Posted : 21/04/2020 5:00 am
(@brunomelki)
Posts: 46
Trusted Member
Topic starter
 

Quick response.. Thanks.

Actualy, I succeded to get it with pivot table but I need to perform additional maths based on the results. I didn't succeed to take the results table back to the original one neither.

I attach the blog01-1 simplified example with the cummulative I calculated (easy to do for some rows only) and an example of math I need to add "[%] of cases". I have some more statistics like that to perform. The yellow are the data I have and the blue are calculated columns.

It is possible ?

 
Posted : 21/04/2020 3:32 pm
Share: