+ Reply to Thread
Results 1 to 6 of 6

look up first and last instance

  1. #1
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    look up first and last instance

    HI,

    Please see the attached example.

    On tab 1 we have data validation in cell A1 which is a date.

    On tab 2 we have a record of when someone logs on.

    What I'm looking for is a lookup which looks at the date and the user and gives the date and time of when they first and last logged in.

    So for example on the 3/9/2013, First would be 03/09/2013 03:17 and last would be 03/09/2013 23:45

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: look up first and last instance

    see the attachment
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: look up first and last instance

    For Login - in cell C4
    =SMALL(IF(DATE(YEAR(Sheet2!$C$2:$C$11),MONTH(Sheet2!$C$2:$C$11),DAY(Sheet2!$C$2:$C$11))=$A$1,Sheet2!$C$2:$C$11),1)

    &

    For Logout - In cell D4
    =LARGE(IF(DATE(YEAR(Sheet2!$D2:$CD$11),MONTH(Sheet2!$D$2:$D$11),DAY(Sheet2!$D$2:$D$11))=$A$1,Sheet2!$D$2:$D$11),1)

    Please paste both with Ctrl+Shift+Enter
    Please click 'Add reputation', if my answer helped you.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: look up first and last instance

    Another:

    C4
    =MIN(IF(Sheet2!A2:A11=Sheet1!B4,Sheet2!C2:C11,100000)*IF(ROUNDDOWN(Sheet2!C2:C11,0)=Sheet1!A1,1,100000))

    D4:
    =MAX(IF(Sheet2!A2:A11=Sheet1!B4,Sheet2!C2:C11,0)*IF(ROUNDDOWN(Sheet2!C2:C11,0)=Sheet1!A1,1,0))

    confirm with ctrl+shift+enter

  5. #5
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    Re: look up first and last instance

    Thanks everyone for your help

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: look up first and last instance

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. First and Last instance of a Value
    By Grimace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2011, 02:10 AM
  2. [SOLVED] instance of class in dll, is it possible??
    By rchiu5hk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2009, 01:14 AM
  3. VLOOKUP - Last Instance
    By jndickin in forum Excel General
    Replies: 4
    Last Post: 08-11-2009, 03:39 PM
  4. [SOLVED] How do I get rid of a 2nd instance (xls:2)?
    By greenwellies in forum Excel General
    Replies: 4
    Last Post: 04-23-2006, 11:50 PM
  5. xl instance
    By tom taol in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2005, 01:06 PM

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