Given a column of ordered dates (note that some dates are missing or duplicated) and corresponding values like this:
10/18/2013 6
10/19/2013 8
10/21/2013
10/22/2013
10/23/2013
10/25/2013 8
10/25/2013 5
10/25/2013
10/28/2013
10/28/2013
10/28/2013 6
10/28/2013
10/28/2013 8
10/28/2013
10/28/2013
10/30/2013 4
10/31/2013
10/31/2013
I want to sum all values in the righthand column going back N days ago (inclusive or exclusive doesn't matter, whichever is simplest).
For example, today is 11/4/2013, so if N were 10, the summation would start at 10/26/2013, and the calculated value would be 18 (6+8+4).
Note that 10/26/2013 is missing -- If the calculated starting date doesn't exist, then start at the next most recent date (10/28/2013 in this case).
TIA for any help!
Bookmarks