+ Reply to Thread
Results 1 to 9 of 9

Excel Sumproduct function linked to Date & Time not gives proper result

  1. #1
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Excel Sumproduct function linked to Date & Time not gives proper result

    I have the functions in the attached file.

    I have a sumproduct function with two conditions.

    When the Condition is linked to column formatted as Date & Time it doesnt give the proper answer, but when the same date is formatted as decimal number it gives correct answer.

    Is there are a way to build this into the function without having to create a helper column ???
    Attached Files Attached Files
    Last edited by ibuhary; 02-20-2018 at 09:33 AM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    What appears to be date and time in column B are actually text.

    You can convert them all to numeric date and time by selecting data in column B, then use Text To Columns, selecting fixed width and eliminating the column delimiters.

    Alternatively, select the data in column B, press ctrl+H (Find/Replace) and replace ":" with ":".

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Excel Sumproduct function linked to Date & Time not gives proper result

    With PowerQuery (add-in for Ex2010 Pro Plus)

    is that what you want?

  4. #4
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    I am afraid I am unable to do any changes in the column - Date & Time 1

    Its coming from data sources and also linked to many things. I have room only to play in Column D

    I am thinking of using something like =SUMPRODUCT(--($A$2:$A$28=A2),--(($B$2:$B$28+0)<B2)) to try to convert the data to numbers, but it doesnt work.
    Last edited by ibuhary; 02-20-2018 at 09:22 AM. Reason: Adding more description

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    Quote Originally Posted by ibuhary View Post
    =SUMPRODUCT(--($A$2:$A$28=A2),--(($B$2:$B$28+0)<B2))
    Change to:

    =SUMPRODUCT(--($A$2:$A$28=A2),--($B$2:$B$28-B2<0))

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    When I open your file, I see a pile of #VALUE errors. in Columns B & D. This formula in C2, copied down:

    =DATE((MID(B2,7,4)),(LEFT(B2,2)),(MID(B2,4,2)))+RIGHT(B2,8)+0

    cures that (format as dd/mm/yyyy hh:mm). However, i have no idea what you are trying to achieve!!!
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  7. #7
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    Wow, thats the one I was looking for, works like a Gem.

    But can you please explain me the logic behind that.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    Who are you talking to?

  9. #9
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Excel Sumproduct function linked to Date & Time not gives proper result

    I was trying to convert the data format to Numbers in the Destination Cell itself.

    It worked what @Phuocam suggested...

+ 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] Unable to get the proper time and date output with dd hh:mm:ss
    By mark888 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-05-2015, 04:39 AM
  2. Convert Long Written Excel Date to Proper Date
    By DavidMichaelangelo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2013, 04:47 PM
  3. [SOLVED] Proper syntax for a SUMPRODUCT() function?
    By billj in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-15-2013, 01:34 PM
  4. Date/Time Function in Excel (Day/Month/Year & time)
    By tortuga32 in forum Excel General
    Replies: 19
    Last Post: 12-14-2011, 02:00 AM
  5. Excel SUMPRODUCT function with date calculation criteria
    By jcountzler in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-11-2009, 11:44 AM
  6. Replies: 0
    Last Post: 08-23-2005, 12:24 PM

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