+ Reply to Thread
Results 1 to 6 of 6

Sumproduct formula failing after turn of the year

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

    Sumproduct formula failing after turn of the year

    This sumproduct formula has failed since the turn of the new year.
    I use it on both open and closed workbooks that span from one year to the next, ie 2016 / 2017.

    Could you please help me to get it working across the year boundry.

    =SUMPRODUCT(('Orders'!$E$13:$E$309)*('Orders'!$D$13:$D$309<=DATEVALUE(TEXT(TODAY(),"dd-mm-")&2016))*('Orders'!$H$13:$H$309='Orders'!$D$2))

    Thanks in anticipation.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,419

    Re: Sumproduct formula failing after turn of the year

    You have hard-coded 2016 in the formula, so you are looking for dates that are less than 01/01/2016. I think it would be better to have this as your middle term:

    ... *('Orders'!$D$13:$D$309<=TODAY())* ....

    Hope this helps.

    Pete

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

    Re: Sumproduct formula failing after turn of the year

    Hi Pete,
    Thanks for your reply, unfortunately by using your fix the formula returns the total for the period rather than the amount up to and including todays day & month.

    The sheets could be 2016/17, 2015/16, 2014/15 etc

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,419

    Re: Sumproduct formula failing after turn of the year

    In your formula I only see references to an Orders sheet, so I'm not sure what your final sentence means.

    You said that the formula stopped working at the turn of the year (i.e. today), and I can see that you want to sum column E when column D is less than or equal to some date and column H is equal D2. The date is given by today's day and month, with the year set to 2016, so if you were using this formula (successfully) on 1st December last year, say, then the date you are comparing with would be 1st December 2016 (i.e. the same as the TODAY() function would return on that day), which is why I suggested that change.

    I think you need to explain more fully what you want to achieve, and may attach a sample Excel file.

    Hope this helps.

    Pete

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

    Re: Sumproduct formula failing after turn of the year

    Ok, solved the issue, all working perfectly now.

    I replaced DATEVALUE(TEXT(TODAY(),"dd-mm-")&2016))

    with DATEVALUE(TEXT(TODAY(),"dd-mm-")&RIGHT($B21,2))

    Where b21 contains the year data, such as 2016/17

    Thanks for trying to help, I'll close this post now.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,419

    Re: Sumproduct formula failing after turn of the year

    Glad you were able to solve it - thanks for feeding back (I don't think anyone could have guessed that you had 2016/17 in cell B2 !!).

    Pete

+ 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. [SOLVED] How to Turn a Sumproduct into a Sumif
    By cartica in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2014, 05:35 PM
  2. Turn SUMPRODUCT into some fancy VBA code formula
    By questionguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2012, 07:30 PM
  3. [SOLVED] Turn Sumproduct Calculation Into vba
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 06:01 AM
  4. [SOLVED] Adjustment to SUMPRODUCT Formula to pull one year
    By tougat1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-09-2012, 01:47 PM
  5. How to turn sumproduct to sumifs?
    By stormracela in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2010, 09:20 PM
  6. Multiple date based SUMPRODUCT failing
    By smninos in forum Excel General
    Replies: 14
    Last Post: 11-24-2009, 02:30 PM
  7. Date to turn red if within the year
    By bmunoz64 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-30-2009, 04:21 PM

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