+ Reply to Thread
Results 1 to 6 of 6

SUMIF dates return wrong value

  1. #1
    Registered User
    Join Date
    07-22-2016
    Location
    Vancouver, BC
    MS-Off Ver
    2013
    Posts
    3

    SUMIF dates return wrong value

    I have a simple equipment inspection schedule like this:

    A B C D E F G
    Equipment Time(Min.) Day 1 Next day Next day Next day Next day
    Chiller 10.00 2018-07-01 2018-07-05 (=C+4) 2018-07-09 2018-07-13 2018-07-17
    Tank 2.00 2018-06-30 2018-07-30 (=C+30) 2018-08-29 2018-09-28 2018-10-28
    Boiler 1 5.00 2018-06-29 2018-06-30 (=C+1) 2018-07-01 2018-07-02 2018-07-03
    Boiler 2 5.00 2018-06-29 2018-06-30 (=C+1) 2018-07-01 2018-07-02 2018-07-03

    Column C is manually entered dates. D to G are formulas e.g C+4, E+4 etc.

    I have a SUMIF formula looking for totals for a certain date. The range is columns C to G, criteria is a date, sum range = column B.

    =SUMIF($C$2:$G$5,A9,$B$2:$B$5)

    The values return aren't quite right:

    2018-06-29 2018-06-30 2018-07-01 2018-07-02 2018-07-03 2018-07-04 2018-07-05 (Criteria)
    10.00 4.00 86570.00 86562.00 86564.00 86566.00 86576.00 (Sumif results)

    As you can see, only the 2018-06-29 returns the correct value. The rest are way off. All the dates are serial dates.

    I have attached the Excel file here.

    What did I do wrong? Can someone please help?

    Thanks very much!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: SUMIF dates return wrong value

    The sum range and criteria range both have to be of equal size. Even though You have only specified column B as the sum range, the formula compares the values in column B to the dates in column D, the values in column C to the dates in column E and so on.

    Here's a workaround method that will give you the correct results.

    =SUMPRODUCT(SUMIF(OFFSET($D$2,0,COLUMN($D$2:$Q$2)-COLUMN($D$2),ROWS($D$2:$D$5),1),A9,$B$2:$B$5))

  3. #3
    Registered User
    Join Date
    07-22-2016
    Location
    Vancouver, BC
    MS-Off Ver
    2013
    Posts
    3

    Re: SUMIF dates return wrong value

    Thanks very much jason.b75! SUMPRODUCT works!!!

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: SUMIF dates return wrong value

    A shorter solution in A10 then drag accross:
    Please Login or Register  to view this content.
    Quang PT

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: SUMIF dates return wrong value

    Nice one bebo!

    Maybe I should have tried the simple solution before dismissing it and posting a convoluted one.

    For some reason I had it in mind that the simple version would only count 1 correct result per row regardless of the number of occurrences

  6. #6
    Registered User
    Join Date
    07-22-2016
    Location
    Vancouver, BC
    MS-Off Ver
    2013
    Posts
    3

    Re: SUMIF dates return wrong value

    Thank you

+ 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. What is wrong with this SUMIF?
    By drgkt in forum Excel General
    Replies: 5
    Last Post: 02-06-2017, 03:33 AM
  2. [SOLVED] sumif, function picking wrong value
    By nicci113 in forum Excel General
    Replies: 12
    Last Post: 11-20-2014, 01:21 PM
  3. SUMIF shows wrong value
    By psykfall123 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-29-2012, 10:33 AM
  4. sumif formula adding wrong!
    By Daanish in forum Excel General
    Replies: 7
    Last Post: 09-01-2010, 12:36 PM
  5. Sumif Or Am I Using Wrong Formula
    By suzy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-31-2008, 05:39 PM
  6. Simple SUMIF formula gone wrong!
    By exutable in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-08-2006, 06:58 AM
  7. sumif wrong result
    By tallyman00 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-29-2005, 01:11 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