Jump to content
We've recently updated our Privacy Statement, available here. ×

How to get sum of previous 2 (or any number) values based on another column(s)

David Jones 5

Recommended Posts

Dataset looks something like this:


I would like to get the sum of the values based on the ranking of column RR descending. For example - I would like the sum of column PD based on the previous 2 distinct values in column W and column PS ranked by RR desc. So, for PS 1, I would want 500 + 900 = 1400 ( the values from W.A and W.B because W.D does not have a PS.1). For PS.2, I would want 1250 + 1100 = 2350 because W.A has a PS.2 and W.D has a PS.2. So I need to rank everything by RR. Then look at the PS to make sure it exists, if not move on to the next one. The next step for this would be to sum up the column AH for each corresponding PD that was summed up. So for PS.1, the sum for AH would be 8.5.

The Column PS is currently my X axis.

Thanks in advance for the help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...