ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Summing based on dates (https://www.excelbanter.com/excel-worksheet-functions/261201-summing-based-dates.html)

Mike[_28_]

Summing based on dates
 
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. Valko

Summing based on dates
 
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

--
Biff
Microsoft Excel MVP


"Mike" wrote in message
...
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?




ajnmxx

Summing based on dates
 
Perfect! Thank you so much for your help, much appreciated.

T. Valko

Summing based on dates
 
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"ajnmxx" wrote in message
...
Perfect! Thank you so much for your help, much appreciated.





All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com