+ Reply to Thread
Results 1 to 5 of 5

How to calculate time between login and logout times?

  1. #1
    Registered User
    Join Date
    09-05-2022
    Location
    England
    MS-Off Ver
    365
    Posts
    2

    How to calculate time between login and logout times?

    Hi,

    I am running a service desk which is required to operate between certain hours. I want to check my staffs login and logout times over the week and calculate if they owe any time.

    Here is an example piece of data that report produces (Time, Agent, Type, Description):

    02/09/2022 10:37 Agent 1 phone Agent Answered
    02/09/2022 10:37 Agent 2 phone Agent Disconnected
    02/09/2022 10:37 Agent 2 phone Caller Disconnected
    02/09/2022 10:37 Agent 3 phone Agent Disconnected
    02/09/2022 10:37 Agent 3 phone Caller Disconnected
    02/09/2022 10:37 Agent 1 phone Attempted Call To Agent
    02/09/2022 10:35 Agent 4 phone Call Wrapped Up
    02/09/2022 10:35 Agent 5 Agent Logged Out
    02/09/2022 10:35 Agent 5 Agent Logged Out
    02/09/2022 10:34 Agent 6 phone Connected Caller To Agent
    02/09/2022 10:34 Agent 6 phone Agent Answered
    02/09/2022 10:34 Agent 6 phone Attempted Call To Agent
    02/09/2022 10:34 Agent 4 phone Agent Disconnected
    02/09/2022 10:34 Agent 4 phone Caller Disconnected
    02/09/2022 10:34 Agent 1 phone Call Wrapped Up

    So I need to first dig out each agents login and logout instances from column D, then I need to calculate the difference between the login and logout time for that day from column A. The agent should be logged on from 8am until 4pm, or from 10am to 6pm.

    Is this possible with this data or is there too much work involved to get this?

    Kind regards,
    Adam
    Attached Files Attached Files
    Last edited by AdMurray10; 09-05-2022 at 08:23 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,457

    Re: How to calculate time between login and logout times?

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-05-2022
    Location
    England
    MS-Off Ver
    365
    Posts
    2

    Re: How to calculate time between login and logout times?

    Hi Ali,

    Many thanks! I have uploaded an example of the data I have now as an attachment and done another table on the right of it explaining what data I would like to grab from it.

    Hope this helps!

    Kind regards,
    Adam
    Last edited by AliGW; 09-05-2022 at 08:30 AM. Reason: Please DON'T quote unnecessarily!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: How to calculate time between login and logout times?

    As modeled in G7:J13
    1. Cell G7 displays the agent being audited using data validation: =OFFSET($M$2,0,0,SUMPRODUCT(--($M$2:$M$4<>"")))
    Note that the list of agents is in cells M2:M4 which are populated using: =IFERROR(INDEX(B$2:B$14,MATCH(0,INDEX(COUNTIF(M$1:M1,B$2:B$14),,),)),"")
    2. Cell H7 is populated using: =COUNTIFS(B2:B14,G7,D2:D14,"Logged In")/2
    3. Cells G9:G11 are populated using: =IF(ROWS(G$9:G9)<=H$7,G$7,"")
    4. Cells H9:I11 are populated using: =IF($G9="","",AGGREGATE(14,6,$A$2:$A$14/($B$2:$B$14=$G9)/($D$2:$D$14=H$8),ROWS(H$9:H9)*2))
    5. Cells J9:J11 are populated using: =IF(G9="","",MROUND(I9-H9,1/1440))
    6. Cell J13 is populated using: =SUMPRODUCT(--(G9:G11<>""))*8/24-SUM(J9:J11)
    Note the formatting for cells J9:J11 and J13 is h "Hrs "m "Mins"
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,824

    Re: How to calculate time between login and logout times?

    Why are there always duplicate entries?

    Will there always be a log out if there is a log in? If so, then try these 365 formulas:

    In G2:

    =UNIQUE(FILTER(CHOOSE({1,2},$B$2:$B$14,$A$2:$A$14),$D$2:$D$14="Logged In"))
    (This will populate columns G and H)

    In I2:
    =UNIQUE(FILTER($A$2:$A$14,$D$2:$D$14="Logged out"))

    In J2 for Total Owed Time, stealing what JeteMC had:
    =IF(INDEX(G15#,,1)="","",MROUND(I15#-INDEX(G15#,,2),1/1440))

    =COUNT(J2#)*8/24 - SUM(J2#)

+ 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] Help graphing login logout times over a 24 hour period
    By aengus01 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 05-22-2018, 06:36 AM
  2. Finding the First Login and Last Logout Times of Employees
    By ExcelTip in forum Tips and Tutorials
    Replies: 19
    Last Post: 02-17-2018, 01:47 AM
  3. Replies: 0
    Last Post: 02-17-2014, 07:44 AM
  4. First login and Last logout times of windows system
    By chinraj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2014, 05:52 AM
  5. Maximum value from login and logout times
    By callan133 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 07:22 AM
  6. login and logout time , with total login time ,break> 1 hours
    By shrinivasmj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2013, 05:37 AM
  7. Spreadsheet to determine login / logout times
    By fullysic in forum Excel General
    Replies: 2
    Last Post: 12-08-2010, 09:25 AM

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