Summing based on dates

M

Mike

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?
 
T

T. Valko

Try this...

A1:A21 = dates
B1:B21 = mileage

E1:E? = week ending dates

Enter this formula in F1:

=SUMIF(A$1:A$21,">"&E1-7,B$1:B$21)-SUMIF(A$1:A$21,">"&E1,B$1:B$21)

Format as General or Number

Copy down as needed
 

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