+ Reply to Thread
Results 1 to 4 of 4

Sumproduct with Time Duration calculation

  1. #1
    Registered User
    Join Date
    04-05-2007
    Location
    Lombard, Illinois
    Posts
    60

    Sumproduct with Time Duration calculation

    Hi All,

    I'm using a sumproduct formula with multiple conditions to count the number of rows. I'm having trouble with a time duration calculation.

    At first I was trying to calulate the duration in the subproduct like this. But I get an error #value
    =SUMPRODUCT(--('Query Data'!$B$2:$B$1000="NOC Incident"),--(('Query Data'!$G$2:$G$1000-'Query Data'!$F$2:$F$1000)>"00:10:10"))

    Then I tried calculating the duration in a separate column and testing that column, but all I get is 0
    =SUMPRODUCT(--('Query Data'!$B$2:$B$1000="NOC Incident"),--('Query Data'!$O$2:$O$1000>"00:59:59"))
    I've formatted the field as time 37:30:50

    I'm trying to count the rows where the duration is greater than 1 hour.
    Attached Files Attached Files

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Sumproduct with Time Duration calculation

    Try this

    =SUMPRODUCT(--(($C$2:$C$1000-$B$2:$B$1000)>=--"01:00:00"))

    and there is no need to array-enter SUMPRODUCT

  3. #3
    Registered User
    Join Date
    04-05-2007
    Location
    Lombard, Illinois
    Posts
    60

    Re: Sumproduct with Time Duration calculation

    Quote Originally Posted by Bob Phillips View Post
    Try this

    =SUMPRODUCT(--(($C$2:$C$1000-$B$2:$B$1000)>=--"01:00:00"))

    and there is no need to array-enter SUMPRODUCT

    Thanks it works great.
    My understanding was that you need array-enter with sumproduct, especially if you have multiple conditions.
    Last what does the "--" after ">=" represent or mean?

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Sumproduct with Time Duration calculation

    Quote Originally Posted by gav0101 View Post
    My understanding was that you need array-enter with sumproduct, especially if you have multiple conditions.
    That is a mis-understanding then, SUMPRODUCT intrinsically workss with arrays, so there is no need to array-enter it, with or without multiple conditions.

    Quote Originally Posted by gav0101 View Post
    Last what does the "--" after ">=" represent or mean?
    That is what makes my version work whereas yours didn't - see http://www.xldynamic.com/source/xld.SUMPRODUCT.html

+ 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