You are here:

# Excel/Calculate week ending from current date

Question
QUESTION: Considering each row in my spreadsheet is a data item with current date. I want to be able to calculate week ending date and sum up or collate the data items for each week. How do I do that? thank you very much!

what do you consider the week ending date?  Assume it is Friday.

Assume in row 2, the date in question is in C2.  Further assume that dates in column C will fall on Monday - Friday (no weekend dates)

then you can get friday of that week with

=C2+CHOOSE(WEEKDAY(C2,2),4,3,2,1,0)

If it is not Friday you want and or the dates may be on weekends, then post back with the specifics.

if you want to sum all values in column D for dates in column C between 3 Dec 2012 and 7 Dec 2012 then you can do

=Sumifs(D:D,C:C,">=12/03/2012",C:C,"<=12/07/2012")

if you used the formula to produce the Friday date in say column E, then you could do

=Sumif(E:E,"12/07/2012",D:D)

Again, I have had to make assumptions about what data you have, what your rules are and so forth.  If you can not adapt what I suggest to you specific situation, then post back with your details.  Also, the SUMIFS formula (with an S on the end) is only available in Excel 2007 and later.  If you have an earlier version you could just do

=Sumif(C:C,">=12/03/2012",D:D)-Sumif(C:C,">12/07/2012",D:D)

--
Regards,
Tom Ogilvy

---------- FOLLOW-UP ----------

QUESTION: Thank you so much Tom! I should have given you more detail. I am working with pivot tables. The source data consists of "Activities", one activity per row with the date the activity began as a data field in the row. I now need to generate reports of these activities over a period of 7 days (week). Ideally, I would like to be able to generate a field in the source data via VLOOKUP that would identify each row with that week ending date or some identifier that would enable me to pivot on this new field so that I can aggregate the information over each 7 day period. I hope this makes more sense. If it doesn't, I can add a sample table to the question. Thanks very much for the help!!

Sabina,

Based on what you say, I answered the question

=C2+CHOOSE(WEEKDAY(C2,2),4,3,2,1,0)

would put the ending period if it ended on friday.

now if you want a 7 day week, then I assume it still starts on Monday, so

=C2+CHOOSE(WEEKDAY(C2,2),6,5,4,3,2,1,0)

gives the Sunday at the end of the Week.  You would then use that column in your pivot table to limit you output to that ending date.

If you need more help than that, then send a sample data sheet to twogilvy@msn.com with a complete explantion of what you want to do.
--
Regards,
Tom Ogilvy

Questioner's Rating
 Rating(1-10) Knowledgeability = 10 Clarity of Response = 10 Politeness = 10 Comment thank you very much - please look at my second question I sent last time.

This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Tom Ogilvy

##### Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

##### Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.