Summing based on dates

A

ajnmxx

I go running and have a mileage log. I have a list of non-continuous
dates in column A (i.e. I don't run every day), and mileage figures
in
column B.
On a separate part of the worksheet I want to put a summary table
that
shows a summary by week. So the first column will be "weekending"
date
and the second column mileage for the last seven days. I can't work
out how to put an automatic formula in this second column. Sure, I
could do a manual formula that just sums up the 3 or 4 days in that
week that I ran, but there must be a better way?
 
J

JLatham

Ok, for everything on the same sheet, with run dates in A and run mileage in
B, assuming 'week ending' date in column F (and formula to go into G) and
this formula would be for row 2:
=SUMPRODUCT(--($A:$A<=F2),--($A:$A>=F2-6),($B:$B))
 
J

JLatham

Just an added thought: if you put your first 'week ending' date into row 2,
say in cell F2 and the formula I provided into G2, then in F3 you could put
=F2+7
then copy the formula from G2 into G3 and then fill the two formulas in
F3:G3 on down the sheet to build a list of "week ending" dates and results
very easily.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top