+ Reply to Thread
Results 1 to 6 of 6

vLookup Maybe?

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Andover, MA
    MS-Off Ver
    Excel 2007
    Posts
    7

    vLookup Maybe?

    Hello Everyone,

    Another day, another peoblem with excel. I was hoping someone on this board can help me out. I am trying to write up a vLookup query to pull information from the data set so I can create my own table for testing purposes. I have attached the sample data in this post.

    Basically, I am conducting an test on the users within the LDAP system for appropriate access. I wrote a function in column A to assign a unique number to every set of data. So each person may have multiple line items to them...for example, someone with two direct reports may have two line items than the person with no direct reports. i would like to be able to pull the data from column B within this large population based on the number in column A (which assigns each grouping its own number). Maybe a vLookup that would say, column A = 1, column B starts with cn:

    I'm not really sure if this is even the way to go about it. I hope i've explained it well enough but if not, I'll be around to answer any clarifying questions.

    Thank you for your time.
    Attached Files Attached Files

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

    Re: vLookup Maybe?

    So do you want to pull the item from each number code that starts with cn:?

    If so, If you list the unique, column A numbers in, say, L1 down, then in M1 try formula:

    =TRIM(SUBSTITUTE(INDEX($B$1:$B$104,MATCH(1,INDEX(($A$1:$A$104=L1)*(LEFT($B$1:$B$104,2)="cn"),0),0)),"cn:",""))

    adjust ranges to suit and copy down.

    This formula also removes the "cn:" prefix.
    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
    Registered User
    Join Date
    12-09-2011
    Location
    Andover, MA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: vLookup Maybe?

    Thank you for your reply NBVC. I do see what you're trying to do here, but I'm still getting a #N/A when I put in the formula in M1, and the data from column A in L. Any clues?

  4. #4
    Registered User
    Join Date
    12-09-2011
    Location
    Andover, MA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: vLookup Maybe?

    NBVC, I stand corrected, the code you provided does work. But that initiates another problem though. As shown in the sample data set. one user can have multiple items for their account. In the case of this audit, I have a spreadsheet with over 400,000 line items and 8,000 users - so say 50 line items per user. With the code that you provided, it gives me the data I'm looking for, but 50 times. Is there another step I can run after this to pull the value once from each user instead of the 50 times?

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: vLookup Maybe?

    Please Login or Register  to view this content.



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

    Re: vLookup Maybe?

    You only need to list the unique codes one time each in column L, then the Vlookup finds only the cn:NAME from column B.

    Is that not what you needed?
    Attached Files Attached Files

+ 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