+ Reply to Thread
Results 1 to 5 of 5

Find work day duration

  1. #1
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Find work day duration

    Hello,

    I have a table with the following data fields:
    Tel Ext
    Date
    Start Time
    End Time

    Work day duration for selected date and Tel Ext equals to Max(End Time)-Min(Start Time).
    How can I calculate it within the worksheet ?

    I attached an excel workbook with data example.

    Thank you for your help
    Attached Files Attached Files
    Last edited by Snoopy2003; 04-24-2012 at 05:54 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Find work day duration

    Perhaps:

    In J5: =MAX(IF(($A$4:$A$13=J3)*($B$4:$B$13=J4),$D$4:$D$13)) and confirmed with Ctrl+Shift+Enter
    In J6: =MIN(IF(($A$4:$A$13=J3)*($B$4:$B$13=J4),$C$4:$C$13)) and confirmed with Ctrl+Shift+Enter
    In J7: =J5-J6

    You may have to change , to ; depending on your delimiters.

    ??
    Last edited by Søren Larsen; 04-24-2012 at 05:38 PM. Reason: Due to Paul's observation in #3
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Find work day duration

    I think your second formula is meant to be the MIN Start Time (based on the post text, even though the spreadsheet says MIN end time).

    J5: =MAX(IF(A1:A20=J3,IF(B1:B20=J4,D1:D20)))
    J6: =MIN(IF(A1:A20=J3,IF(B1:B20=J4,C1:C20)))
    J7: =J5-J6

    The formulas in J5 and J6 are array formulas and must be confirmed using CTRL+SHIFT+ENTER, not just ENTER. Format J5 and J6 as Time. Format J7 as "h:mm".

  4. #4
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Find work day duration

    Hello,

    I think your second formula is meant to be the MIN Start Time

    You are right, sorry for the mistake in the example file.

    Søren Larsen and Paul - thank you for your quick response and help.
    I tried your suggestion and it worked like a charm.
    I tried to solve this for several hours with no success.

    Thank you for your time.

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Find work day duration

    We're glad to be of assistance.

+ 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