+ Reply to Thread
Results 1 to 3 of 3

Sumif formula across dates not working correctly

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Sumif formula across dates not working correctly

    I have attached a piece of a KPI spreadsheet I am working from. Basically, I want to sum up YTD and YTD average based on the month I am in. I don't know why the formula won't work. I expected that when I chnaged the month (Cell U4), any month less than that month would be summed (T12) and give me the average based on the month I present. Instead, if I make it less than the month it gives me a value of zero, and if I say greater than it gives me the whole year.

    What's wrong here?

    Thanks!

    Broken YTD.xlsx

    Also, anyone know how to delete all those unused styles??? A consequence of copying a worksheet into this copy and now its bogging the file a little.

    Thanks!!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Sumif formula across dates not working correctly

    Hello,

    your date formats are not consistent. In U4 you have 1-July-2014, but in F4 you have 11-Jan-2014, not 1-Nov-2014. Or maybe that's just because DATEVALUE() comes up with a different result because of my regional settings.

    To avoid this risk, use Date() instead of Datevalue(), because it is unambiguous. In F4 use

    =DATE($C$6-1,F2,1)

    Copy to G4. Then isn H4 use

    =DATE($C$6,H2,1)

    and copy to the right.

    Now the result will be 0 because U2 is looking at 1-July-2014. Change it to 1-Jul-2015 and the result is correct.

    cheers, telyn

  3. #3
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Sumif formula across dates not working correctly

    Worked like a charm. Thank you - don't know why I went with that date value - was more due to the solution I found for the concat I had to do. This is working great and DATE is easier for me to follow.

    Repped.

+ 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. Formula not working correctly
    By Burt_100 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2014, 07:08 AM
  2. Sumif function not working correctly
    By chouston in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-14-2014, 04:02 PM
  3. [SOLVED] Filtering by Dates not working correctly
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2014, 02:08 AM
  4. [SOLVED] Calculating difference between 2 dates in excel 2003 - formula not working correctly
    By cf7046 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 10:18 PM
  5. Replies: 9
    Last Post: 03-08-2013, 11:50 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