+ Reply to Thread
Results 1 to 6 of 6

Formula to get the last logon time of employee (Max IF)

  1. #1
    Registered User
    Join Date
    02-04-2018
    Location
    Vietnam
    MS-Off Ver
    Office 2016
    Posts
    3

    Post Formula to get the last logon time of employee (Max IF)

    Good day, all,

    I'm newbie on Excel and would like to ask for your help here.

    I tried the formula (MIN IF) and success with first login of the day but doesn't success with logout time by MAX IF.

    I have a table as below (Date & Time, Username)

    Date and Time Name User ID Date Time
    1/1/2018 20:52:02 Nancy 9 1/1/2018 8:52:02 PM
    1/2/2018 07:29:15 Tuyet 10 1/2/2018 7:29:15 AM
    1/2/2018 07:58:53 thuy 12 1/2/2018 7:58:53 AM
    1/2/2018 08:13:08 Rose 26 1/2/2018 8:13:08 AM
    1/2/2018 08:26:29 Nancy 9 1/2/2018 8:26:29 AM

    The formula to export the first logon time is:

    =MIN(IF($B$2:$B$2388=$I$3,IF(INT($D$2:$D$2388)=$M$1,$D$2:$E$2388,2)))

    But the logout formula doesn't work and here is mine formula:

    =MAX(IF($B$2:$B$93=I$3,IF(ISNUMBER(SEARCH($M$1,$D$2:$D$93)),$D$2:$D$93)))

    or
    =MAX(IF($B$2:$B$93=$I$3,IF(INT($D$2:$D$93)=M1,$D$2:$E$93,2)))

    Range B2 to B93 is the time log for the 2 - Jan - 2018.

    You can reference on the image attach for more details.

    Logout Formula.PNG

    My matter could be the same request as the topic: https://www.excelforum.com/tips-and-...ployees-2.html

    Please help to check and advise. Thank you !

  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,430

    Re: Formula to get the last logon time of employee (Max IF)

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Formula to get the last logon time of employee (Max IF)

    Try this

    =MAX(IF(($B$2:$B$93=$I3)*($D$2:$D$93=$M$1),$E$2:$E$93,""))
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Formula to get the last logon time of employee (Max IF)

    Try this. ARRAY formula in N3 then dragdown.

    =MAX(IF(($B$2:$B$93=$I3)*($D$2:$D$93=$M$1),$E$2:$E$93,""))

  5. #5
    Registered User
    Join Date
    02-04-2018
    Location
    Vietnam
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Formula to get the last logon time of employee (Max IF)

    Many thanks kvsrinivasamurthy !

    It works perfect as my requirement !

  6. #6
    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,430

    Re: Formula to get the last logon time of employee (Max IF)

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Formula to find the next time available for an employee.
    By SirBrock in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2015, 12:13 PM
  2. [SOLVED] Need a formula for Employee Time Sheet
    By infantryman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2015, 01:00 AM
  3. Excel tool to track Employee Logon,Logout and Idle time
    By KalyankumarMCA in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-18-2014, 09:07 PM
  4. Replies: 1
    Last Post: 01-10-2013, 12:29 AM
  5. Pivot Table Logon/Logout Time Difference
    By MMcGuinness in forum Excel General
    Replies: 0
    Last Post: 08-31-2011, 07:28 AM
  6. Obtain Logon Time Using VBA
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2010, 11:46 AM
  7. Finding the logon and logoff time for that date
    By luckyros in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 05-18-2009, 02:18 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