+ Reply to Thread
Results 1 to 12 of 12

Excel 2007 : Complex lookup required

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Complex lookup required

    Hi,
    I am currently assiting a friend with their business based on a java based product that is not yet fully developed. In the mean time, we are trying to track the number of users that are logged in currently, but the system events does not included those that have been continiously logged in therefore giving skewed results. So what we have done is exported backdated xls in the hope of trying to work out which clients have been logging in and those that havent logged out, therefore implying that they are still logged in.

    What we need help in doing is to somehow using the 6000+ rows is to find a quick way of returning those people that have not logged out essentially. But to do this we need to correspond the client names with their logging in details, and seperate the clients, then from that individually count each clients logins (the event is named as "Logged in" on our side) and if it gives an odd number they are still logged in, but if even they must have logged out.

    We have tried combining h and v lookups with counif and such but we cannot seem to get anything to do what is required, so any help is appreciated.

    Many Thanks

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex lookup required

    Probably best to attach a sample workbook showing what you have/what you want.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Complex lookup required

    Hi Ayo123 and welcome to the forum.

    A sample file would be great to see what you expect the result to look like. Find attached a fake file and a possible answer.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    07-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Complex lookup required

    Hi,

    Apologies, that was an error on my part. Ive got attached a demo, all the values are false but the idea is essentially the same.

    Thanksdemo2.xlsx

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex lookup required

    So you want all the rows with event Logged In separated into Sheet2?

  6. #6
    Registered User
    Join Date
    07-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Complex lookup required

    If it is possible to pull all the events that are 'Logged in and Logged out' into a different sheet as a counted figure for each individual person. So for 'Ray Jones' he has logged in and logged out therefore the figure will be 2. Then with that 2 we will know that he is logged out because it is even. If it were say 'Chuck Norris' who has 'Logged in', 'Logged out', 'logged in', the number will be 3, implying he is still logged in.

    I hope that helps

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex lookup required

    perhaps a Pivot table would be the way to go?

    First add a column to "index" the logged cells.

    so in I1 enter a title like "Logged Status", and I2 of Sheet1, add formula:

    =--(LEFT(F3,4)="Logg")

    copied down (this will included Logged In, Logged Out, Logging In, Logging Out)

    then go to Insert|Pivot Table, and send to a new worksheet,

    Then drag Company down to Row Label section and Logged Status to the Summation area...
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Complex lookup required

    You are an absolute God Send! Thanks very much for that, it actually works very well!

    Im guessing if i were to do a thing by that side that instantly says logged in or not, i would do a logic test so if number is odd, logged in, if even logged out?

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex lookup required

    Sorry, I am not understanding the question? Can you elaborate? Are you just looking for a formula that gives a 1 or 0 based on if the person is logged in or out at that row?

  10. #10
    Registered User
    Join Date
    07-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Complex lookup required

    Sorry,

    What you have done is perfect I cannot thank you enough. However, is it possible with these numbers to just make things easier if others look at it by just in the adjecent cell using a formula that says if the number is even then 'Logged Out' appears, if not 'Logged In' appears.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex lookup required

    You mean in C4, beside the pivot table, a formula like:

    =IF(B4=0,"",IF(ISEVEN(B4),"Logged In","Logged Out"))

    copied down?

    Note: If you add info in the database, you will need to refresh the pivot table, and copy down the formula if more rows were added to the pivot table.

  12. #12
    Registered User
    Join Date
    07-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Complex lookup required

    Yeah that its.

    Thank you very much for your help! You have saved us alot of time and effort on ourside and it is much appreciated. Hopefully in time we will be as adept in Excel as you are!

+ 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