# Create a cumulative sum within a category

1. ## Create a cumulative sum within a category

Hi guys,

Have been on the drawing board with this for a while, seems like a really simple task but I just cant crack it, got to the stage where the fun problem solving aspect is starting to give way to deadlines!

The data is on the NFL, I have information on each match played and the individual players movements within each match, I am looking to sum information from each previous match so I have each players total at any point in time.

A file with dummy data is attached, the outcome I am looking for is to have the Total to date column work out how many yards each player has had up to that point in time, for example the player with the ID 5486 had 6 yards in 2009, hence the Total to date column would contain a 6. They then went on to make 11 yards in 2010, so the column Total to date should display 17 (11+6). However this obviously needs to differentiate between the different players.

NFL dummy data.xlsx

Tried all sorts of combinations of IF's, and a few Index Matches, the latter seems to be the most promising! Any ideas guys?

Thanks!

2. ## Re: Create a cumulative sum within a category

=SUMIF(A\$2:A2,A2,C\$2:C2)
Try this formula in Cell D2 and copy towards down

3. ## Re: Create a cumulative sum within a category

Ignore my earlier post and try the below one
D2=SUMIFS(C\$2:C2,A\$2:A2,A2,B\$2:B2,"<="&B2)
and copy towards down

4. ## Re: Create a cumulative sum within a category

Thanks! This worked in the example spreadsheet but then not in my actual dataset, i've attached the actual dataset but can see no reason why its not exactly the same?

Also, for anyone else using this post, this needs to be sorted by date right?

OFFENCE NFL.xlsx

Thanks,

5. ## Re: Create a cumulative sum within a category

Sorted, some of my years had changed to text and were not recognised. Thanks for this, really helpful reply!

6. ## Re: Create a cumulative sum within a category

There are currently 1 users browsing this thread. (0 members and 1 guests)