+ Reply to Thread
Results 1 to 15 of 15

Sumproduct formula over cumulative date range failing

  1. #1
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Sumproduct formula over cumulative date range failing

    I hope someone could help me to solve this issue please.

    This sumproduct formula should pull data from the first possible date (ie 1st september) to the current day, whatever that may be. It isn't. It just pulls in the cumulative total
    for the entire year.
    So if today is 2 October, then the sumproduct would be from 1st september to 2nd October but in the year range 2014/15 as held in B42


    =SUMPRODUCT(('[Sales 2015.xlsm] Orders'!$E$13:$E$300)*('[Sales 2015.xlsm] Orders'!$D$13:$D$300<=DATEVALUE(TEXT(TODAY(),"dd-mm-")&RIGHT($B42,2))*('[Sales 2015.xlsm] Orders'!$H$13:$H$300='[Sales 2015.xlsm] Orders'!$D$7)))


    Cell B42 holds the year value 2014/15

    The workbook Sales 2015 is closed

    many thanks

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Sumproduct formula over cumulative date range failing

    There isn't anything in the formula to specify a first date- why is 1st Sep the first possible date? I'd still suggest changing the formula to this
    =SUMPRODUCT(('[Sales 2015.xlsm] Orders'!$E$13:$E$300)*('[Sales 2015.xlsm] Orders'!$D$13:$D$300<=DATE(2000+RIGHT($B42,2),month(TODAY()),DAY(TODAY())))*('[Sales 2015.xlsm] Orders'!$H$13:$H$300='[Sales 2015.xlsm] Orders'!$D$7))
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    Thanks for your reply, I'll try your formula change and report back. Sept 1st start date isn't hard and fast, just an example.

  4. #4
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    xlnitwit, thanks for the formula revision. It gives me the same result as my original formula so not the accumulated total to date.

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Sumproduct formula over cumulative date range failing

    Can you post a sample workbook? I don't really see how that could happen.

  6. #6
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    As requested see sample workbook, hope that helps.
    Regards
    Attached Files Attached Files

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Sumproduct formula over cumulative date range failing

    All of the dates for a are less than 2nd October 2016, which is the date criterion. If you meant 2015, you can't take the rightmost 2 characters of B2. You would require
    =SUMPRODUCT(($D$5:$D$286)*($C$5:$C$286<=DATE(2000+MID($B2,FIND("/",$B2)-2,2),MONTH(TODAY()),DAY(TODAY())))*($G$5:$G$286=$D$2))

  8. #8
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    Ooops.... spoke too soon without fully testing.

    Thank you very much for your help, that seems to do what I'm looking for.

    I would never of figured it out on my own.
    Last edited by sipa; 10-02-2017 at 11:58 AM.

  9. #9
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    Unfortunately moving the system date forward to 1st January the formula fails and reports zero.

    Up to 31st December it's fine, it just fails at the turn of the year. Do you have a solution please ?

  10. #10
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Sumproduct formula over cumulative date range failing

    What exactly are you expecting as the result? None of those dates are less than 1/1/2015 so the answer is 0.

  11. #11
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    for example in the sample sheet if I add dates and data going forward into 2016 and move the system date forward to a date past 31st December, instead of continuing to count the accumulated sales number it reverts to zero.

    The sales year would run from 1st Sept 2015 to 31st august 2016, so the formula needs to count the accumulated sales to todays date whatever that may be.
    I want to be able to see the sales position across a number of years at the current date.
    Does that make anymore sense ?

  12. #12
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    Updated sample file.

    move your system date past31st December to see what I mean.
    Attached Files Attached Files

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Sumproduct formula over cumulative date range failing

    Perhaps simpler to explicitly define the start and end dates in two cells, e.g. in K2 use this formula

    =DATE(2000+MID(B2,3,2),MONTH(TODAY()),DAY(TODAY()))

    and then in L2 to get the date a year later than K2

    =EDATE(K2,12)

    Then you can use a formula that will sum the relevant data with conditions between those dates, i.e.

    =SUMIFS(D:D,C:C,">="&K2,C:C,"<"&L2,G:G,D2)
    Audere est facere

  14. #14
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    Hi daddylonglegs, thanks for the reply and alternative.

  15. #15
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Sumproduct formula over cumulative date range failing

    I'd really like to get this formula working so that it will span 2015/16 properly, any ideas xlnitwit ?

    =SUMPRODUCT(($D$5:$D$286)*($C$5:$C$286<=DATE(2000+MID($B2,FIND("/",$B2)-2,2),MONTH(TODAY()),DAY(TODAY())))*($G$5:$G$286=$D$2))

    Many thanks

+ 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. Sumproduct produces #NUM! error, double unary operator seems to be failing
    By #vlookup in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-21-2017, 03:54 PM
  2. [SOLVED] Sumproduct formula failing after turn of the year
    By sipa in forum Excel General
    Replies: 5
    Last Post: 01-01-2017, 01:13 PM
  3. Cumulative Tier Formula using SUMPRODUCT
    By alewis1983 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2016, 10:22 AM
  4. Replies: 2
    Last Post: 11-26-2014, 12:48 PM
  5. [SOLVED] Sumproduct Formula - With date range and multiple criteria
    By kellydvorak in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2014, 09:07 PM
  6. Multiple date based SUMPRODUCT failing
    By smninos in forum Excel General
    Replies: 14
    Last Post: 11-24-2009, 02:30 PM
  7. [SOLVED] clarification: cumulative to-date total formula needed
    By dreamkeeper in forum Excel General
    Replies: 2
    Last Post: 08-10-2006, 09:55 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