+ Reply to Thread
Results 1 to 5 of 5

problem with SUMPRODUCT looking to match a date range

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    problem with SUMPRODUCT looking to match a date range

    Hi can someone help me with this formula I am having a few problems with:

    =IF(ISNUMBER(G12),SUMPRODUCT((RE_Names=INDIRECT("'Holidays'!C"&COLUMNS($A:I)))*(RE_Dates>=Holidays!$D$3)*(RE_Dates<=Holidays!$E$3)*(RE_Shifts="HOLS")),"") is returning a 0 when it should be returning a number.

    The problem is with Holidays!$D$3 and Holidays!$E$3. They are set to ="01/07/"&YEAR('Extract'!O4) and ="30/06/"&YEAR('Extract'!O4+200) which display 01/07/2013 and 30/06/2014 respectivly. The cells they are in are formatted as a date but the formula doesn't work. It will only work if i type the dates manually.

    Has anyone got any ideas?

    John

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: problem with SUMPRODUCT looking to match a date range

    Perhaps use the following technique to convert the strings to number
    Please Login or Register  to view this content.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: problem with SUMPRODUCT looking to match a date range

    ="01/07/"&YEAR('Extract'!O4) and ="30/06/"&YEAR('Extract'!O4+200)

    I tried that part of your formula and it gave me a valid date?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: problem with SUMPRODUCT looking to match a date range

    ="01/07/"&YEAR('Extract'!O4) and ="30/06/"&YEAR('Extract'!O4+200)

    I tried that part of your formula and it gave me a valid date?

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: problem with SUMPRODUCT looking to match a date range

    ="01/07/"&YEAR('Extract'!O4)+0 worked.

    Thanks Pepe

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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