+ Reply to Thread
Results 1 to 12 of 12

Calculate Login hours

  1. #1
    Registered User
    Join Date
    10-23-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    43

    Question Calculate Login hours

    Hi All,
    I am trying to calculate the Login hours.Below example shows login time and logout time of employees. An employee login hours should be canculated from his First login time to his Last logout time. ex 3200 employee login hours is 10 hours.

    Id Login Time Login Date Logout Time Logout Date
    3200 17:15 10/24/2010 17:46 10/24/2010
    3200 17:50 10/24/2010 22:45 10/24/2010
    3200 22:46 10/24/2010 3:15 10/25/2010
    3201 20:00 10/24/2010 4:00 10/25/2010
    3215 20:15 10/24/2010 4:00 10/25/2010
    3218 0:45 10/24/2010 11:45 10/24/2010
    3245 20:00 10/24/2010 4:00 10/25/2010
    3266 20:00 10/24/2010 4:00 10/25/2010
    3299 20:00 10/24/2010 4:00 10/25/2010
    4100 17:00 10/24/2010 17:10 10/24/2010
    4103 20:00 10/24/2010 4:00 10/25/2010
    4199 8:00 10/24/2010 16:00 10/25/2010
    Last edited by anto1510; 10-24-2010 at 01:17 PM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Calculate Login hours

    Not sure but maybe

    =SUM(MOD((E2:E13+D2:D13)-(C2:C13+B2:B13),1))

    confirmed with Ctrl+Shift+Enter and formatted as [h]:mm. Result is 76:50. Is that what you want?
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    10-23-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Calculate Login hours

    Hmmmm I have attached the sample file for you.
    I used your formula however few things are not coming right.
    Id 3200 first login time is 17:15(10/24) and last logout time is 03:15(10/25) so his login hours should be 10hrs.
    Id 4199 loged in at 08:00 AM(10/24) and loged out at 16:00(10/25) so his login hours should be 32hours.
    Please help ...
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Calculate Login hours

    I think more like :-

    =SUMPRODUCT(((E2:E13+D2:D13)-(C2:C13+B2:B13))*(A2:A13=J4))

    Where J4 is the employee number, gives 9.55 for 3200 which is correct by my math

    31 mins +4h 55m + 4h 29m = 9h55min
    Attached Files Attached Files
    Last edited by squiggler47; 10-24-2010 at 11:39 AM. Reason: Added sample file
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  5. #5
    Registered User
    Join Date
    10-23-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Calculate Login hours

    Yes ,you are correct as per maths 31 mins +4h 55m + 4h 29m = 9h55min only.However if you calculate as per first login and last logout time its 10hrs.I know my requirement may not make sence but thats how i want an output be. Also in the case of 4199 his login hours should be 32 hours.
    Could you please help me with this?

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Calculate Login hours

    but if you meant the difference between the first and last time for an employee then :-

    =SUMPRODUCT(MAX(($D$2:$D$13+$E$2:$E$13)*(A19=$A$2:$A$13))-MIN((1000000*($A$2:$A$13<>A19))+$C$2:$C$13+$B$2:$B$13))

    would work

  7. #7
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Calculate Login hours

    you have to format the cells to a custom time format [h]:mm, otherwise it wont show hours over 24!

    See the sheet I attached, the formula I just sent would give the way you want!

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate Login hours

    You could also try this formula in B18 copied down

    =LOOKUP(2,1/(A$2:A$13=A18),D$2:D$13+E$2:E$13)-SUM(INDEX(B$2:C$13,MATCH(A18,A$2:A$13,0),0))
    Audere est facere

  9. #9
    Registered User
    Join Date
    10-23-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Calculate Login hours

    Thats great Thanks you.
    I would like to learn more about Sumproduct would you mind suggesting me a good website.

    Thanks again

  10. #10
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

  11. #11
    Registered User
    Join Date
    09-23-2019
    Location
    Diliman Quezon City
    MS-Off Ver
    2010
    Posts
    1

    Re: Calculate Login hours

    Can someone help me how to compute all the deductions from lates and undertime. Thank you.
    EMPLOYEE NAME DATE UNDERTIME DAYS OF ABSENCES TOTAL
    Leonis Eunice Anasco 16-Sep 8:45 - 12:00 = 5 5 hours & 32 mins
    19-Sep 9:19 - 6:00= .32

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Login hours

    Administrative Note:

    Hello gcabz.
    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Dave

+ 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