+ Reply to Thread
Results 1 to 9 of 9

How to Sum Range Based on a Date?

  1. #1
    Registered User
    Join Date
    08-20-2015
    Posts
    21

    How to Sum Range Based on a Date?

    Hello! New to the forum here...

    My database shows the production of different products per day in tonnes and we report these tonnes per week (week 33, week 34, etc).
    I would like to summarise the sum of production for each product per week on the front page of the report like WTD (Week To Date), all based on the report's date.
    For instance, say 20/08/2015. This date is week 34 which started on 17/08 and will end on 23/08, so I need to report the sum from 17/08 to 20/08. Next day I open the spreadsheet, it will sum automatically from 17/08 to 21/08, but when that week is over, I need to start summing again the WTD tonnes for the next week.
    Any ideas will be super welcomed.
    Thank you so much!!!


    Sent from my iphone using Tapatalk
    Last edited by LEORITY; 08-20-2015 at 08:35 AM.

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: How to Sum Range Based on a Date?

    Hi

    Use
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Regards

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: How to Sum Range Based on a Date?

    Sheet1 A3:M3 dates, A4:M4 are values
    Formula
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-20-2015
    Posts
    21

    Re: How to Sum Range Based on a Date?

    I will try both today and let you know the outcome!

    Thanks guys!


    Sent from my iphone using Tapatalk

  5. #5
    Registered User
    Join Date
    08-20-2015
    Posts
    21

    Re: How to Sum Range Based on a Date?

    Hey guys,

    I used the following slightly adjusted formula kvsrinivasamurthy posted (which is the same as the Jose Augusto).

    OriginalOne=SUMIFS(Sheet1!$A$4:$M$4,Sheet1!$A$3:$M$3,">="&(TODAY()-WEEKDAY(TODAY(),2)+1),Sheet1!$A$3:$M$3,"<="&TODAY())

    MyOne=SUMIFS(Sheet1!$C$9:$AG$9,Sheet1!$C$6:$AG$6,">="&($B$8-WEEKDAY($B$8,2)+1),Sheet1!C$6:AG$6,"<="&$B$8)
    Where $B$8=TODAY()-1

    I have one more doubt and I really need your smart thoughts.

    It is a similar case. My database gives me the annual budget by month. I want to report the Week To Date (WTD) budget.

    Let's say my budget for August is $3,100. But August started on a Saturday (1/8/2015), so the weeks for August are as follows (my weeks are Monday to Sunday - I always report next morning of each day, 7 days a week):

    Week 31: 2 days, formula has to give me: 3100*2/(31days*2)=$100
    Week 32: 7 days, formula has to give me: 3100*7/(31days*7)=$100
    Week 33: 7 days, formula has to give me: 3100*7/(31days*7)=$100
    Week 34: 7 days, formula has to give me: 3100*7/(31days*7)=$100
    Week 35: 7 days, formula has to give me: 3100*7/(31days*7)=$100
    Week 36: 1 day, formula has to give me: 3100*1/(31days*1)=$100

    When the date is 02/08/2015, I want to see on the budget cell, the average budget for that weeek (I know it will always be $100), but I need a formula that will recognize the week based on today's date minus 1 and will calculate it automatically (like the examples above)

    Hopefully it is well explained... Let me know if you need me to clarify better.

    Thank you so much guys!

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: How to Sum Range Based on a Date?

    Post a sample file.

  7. #7
    Registered User
    Join Date
    08-20-2015
    Posts
    21

    Re: How to Sum Range Based on a Date?

    Hi, attached is the sample file.

    Book1.xlsx

    I always report cumulatively what happened on the previous day (from the 1st day of the month), so after a week I will have the previous day and week info. In August, the month starts on Saturday (week 31). Week 31 will finish on Sunday, so I will have 2 days to report on week 31 for the month of August. Going forward, week 32 starts on Monday (3 August) so I will have a new budget for the week, and so on.

    The results I want are on row 11.

    Thank you so much.
    Last edited by LEORITY; 08-23-2015 at 08:13 PM.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: How to Sum Range Based on a Date?

    In B12 , then dragged
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-20-2015
    Posts
    21

    Re: How to Sum Range Based on a Date?

    Quote Originally Posted by kvsrinivasamurthy View Post
    In B12 , then dragged
    Please Login or Register  to view this content.
    Thank you very much! It worked flawlessly...
    Best regards,
    Leonardo


    Sent from my iphone using Tapatalk

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Check a date range and return value based on the date range
    By KeithCar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-13-2015, 12:55 PM
  2. Highlight Rows Based on Date Range Using Static Date and Current Date
    By SaraStravers in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-23-2015, 07:38 PM
  3. Replies: 5
    Last Post: 01-05-2015, 03:57 PM
  4. VBA to enter date range based on date range in above cell
    By Pierce Quality in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2013, 08:45 AM
  5. [SOLVED] find missing date on every group date list based on range and criteria
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2013, 01:26 AM
  6. [SOLVED] Date Filter based on Cell Input - single date or range of dates
    By babaloo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2012, 10:32 AM
  7. copy date based on date -refer to date range
    By mindpeace in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2006, 08:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1