+ Reply to Thread
Results 1 to 7 of 7

SUMPRODUCT leap year error

Hybrid View

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Essex, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Question SUMPRODUCT leap year error

    Hi.

    Could someone help please, as I can't make head or tales of this...

    SUMPRODUCT((Income!$P$3:$P$500)*(Income!$S$3:$S$500=$B24)*(Income!$J$3:$J$500>=DATEVALUE("01/2/2013"))*(Income!$J$3:$J$500<=DATEVALUE("29/2/2013"))) = #VALUE!

    SUMPRODUCT((Income!$P$3:$P$500)*(Income!$S$3:$S$500=$B24)*(Income!$J$3:$J$500>=DATEVALUE("01/2/2013"))*(Income!$J$3:$J$500<=DATEVALUE("28/2/2013"))) = WORKS

    I don't understand why that doesn't work...

    Thanks

    Rgds
    Peter

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: SUMPRODUCT leap year error

    2013 is not a leap year therfore datevalue("29/2/2013") will result in an error
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SUMPRODUCT leap year error

    Peter

    29/2/2013 isn't a valid date.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    01-30-2013
    Location
    Essex, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: SUMPRODUCT leap year error

    DOH! My leap year calc must be wrong: IF(IF(OR(MOD(D2,400)=0,AND(MOD(D2,4)=0,MOD(D2,100)<>0)),1, 0)=0,28,IF(IF(OR(MOD(D2,400)=0,AND(MOD(D2,4)=0,MOD(D2,100)<>0)),1, 0)=1,29))

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SUMPRODUCT leap year error

    What values in D2?

    If it's today's date the leap year formula returns 29, if it's 2013 it returns 28.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: SUMPRODUCT leap year error

    =IF(OR(MOD(d2,400)=0,AND(MOD(d2,4)=0,MOD(d2,100)<>0)),29, 28)

  7. #7
    Registered User
    Join Date
    01-30-2013
    Location
    Essex, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: SUMPRODUCT leap year error

    It was a little fiscal year error on my part. You have all helped a lot thanks!

    Updated formular (Thanks Martin): =IF(OR(MOD((D2+1),400)=0,AND(MOD((D2+1),4)=0,MOD((D2+1),100)<>0)),29, 28)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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