+ Reply to Thread
Results 1 to 19 of 19

Just need a little help with simple vlookup

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    montreal
    Posts
    59

    Post Just need a little help with simple vlookup

    what am i not doing correctly ?


    I want to be able to search in a list for a matching employee number and provide the name of his secretary.


    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Just need a little help with simple vlookup

    VLOOKUP can lookup values to the left so, try this one instead

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by AlKey; 02-12-2016 at 09:37 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Re: Just need a little help with simple vlookup

    You need to have the director Number first on Sheet 2, since that is what you are searching by. Formula would be =VLOOKUP(B3,Sheet2!B:C,1,0)

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,308

    Re: Just need a little help with simple vlookup

    You need to reverse your data in Sheet2: VLOOKUP uses the first range as the MATCH criteria so needs to be Director is in Column C and Assistant in D

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Just need a little help with simple vlookup

    VLOOKUP requires that the lookup value (11111) be in the left-most column of the lookup table.

    Instead of this...

    Data Range
    C
    D
    2
    Assistance Name
    Director #
    3
    Sarah
    22222
    4
    Julie
    33333
    5
    Samatha
    11111


    You need this...

    Data Range
    C
    D
    2
    Director #
    Assistance Name
    3
    22222
    Sarah
    4
    33333
    Julie
    5
    11111
    Samatha
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    07-28-2008
    Location
    montreal
    Posts
    59

    Re: Just need a little help with simple vlookup

    none of the above work

    can someone provide me with a bit more details

    thanks

    this is my reasoning;

    =VLOOKUP(A1,Sheet2!$A$1:$B$100,2,FALSE)

    mean

    search value in A1 on sheet2 between A1 and A100.

    If you find a match, provide me with the second column and false means I'm looking for an exact match.

    Is that correct ?

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Just need a little help with simple vlookup

    Quote Originally Posted by exced View Post
    none of the above work

    can someone provide me with a bit more details

    thanks

    this is my reasoning;

    =VLOOKUP(A1,Sheet2!$A$1:$B$100,2,FALSE)

    mean

    search value in A1 on sheet2 between A1 and A100.

    If you find a match, provide me with the second column and false means I'm looking for an exact match.

    Is that correct ?
    I think you are wrong.

    Please see attached.
    Attached Files Attached Files

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Just need a little help with simple vlookup

    Once I "flipped" the lookup table around it works for me...

    Data Range
    C
    D
    2
    Director #
    Assistance Name
    3
    22222
    Sarah
    4
    33333
    Julie
    5
    11111
    Samatha


    Data Range
    B
    C
    D
    2
    Director #
    Director Name
    Secretary Name
    3
    11111
    John
    Samatha
    4
    22222
    Peter
    Sarah
    5
    33333
    Sam
    Julie


    This formula entered in D3 and copied down:

    =VLOOKUP(B3,Sheet2!C$3:D$5,2,0)

  9. #9
    Registered User
    Join Date
    07-28-2008
    Location
    montreal
    Posts
    59

    Re: Just need a little help with simple vlookup

    i attached the actual file i am working with but changed the names.

    can you tell me what is wrong and perhaps give me 1 good example in a replied copy?

    I should be good from there,

    Thanks
    Attached Files Attached Files

  10. #10
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Just need a little help with simple vlookup

    In M2-
    Please Login or Register  to view this content.
    Instead of Vlookup Index Match should be used here.
    This is because Vlookup searches the first column in the range specified but index match is more flexible and can search columns from between the data also.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Just need a little help with simple vlookup

    Based on your sample file in post #9...

    This formula entered in M2 and copied down:

    =INDEX(Sheet4!C:C,MATCH(B2,Sheet4!F:F,0))

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,308

    Re: Just need a little help with simple vlookup

    As previously explained you need Consultant in Column A in Sheet4 using VLOOKUP

    then use the following


    =IFERROR(VLOOKUP(B2,Sheet4!$A$2:$F$4,4,FALSE),"")

  13. #13
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Just need a little help with simple vlookup

    Enter in M2 and copy down

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-28-2008
    Location
    montreal
    Posts
    59

    Re: Just need a little help with simple vlookup

    everything works, thank you!!

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Just need a little help with simple vlookup

    Good deal. Thanks for the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  16. #16
    Registered User
    Join Date
    07-28-2008
    Location
    montreal
    Posts
    59

    Re: Just need a little help with simple vlookup

    I have one last question;

    When i query to find the secretary, some consultant have more than one.

    Is the a way I can make it so that when there's more than 1 result for same consultant, it posts it on a seperate lines to the right ?

    Thanks

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Just need a little help with simple vlookup

    Like this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Secretary
    Consultant
    Consultant
    Secretary
    2
    Judy
    111
    111
    Judy
    Bill
    Sandy
    3
    Tina
    222
    222
    Tina
    4
    Linda
    333
    333
    Linda
    Eric
    5
    Bill
    111
    444
    Connie
    Tracy
    6
    Connie
    444
    555
    Tom
    7
    Tracy
    444
    8
    Tom
    555
    9
    Eric
    333
    10
    Sandy
    111
    11
    ------
    ------
    ------
    ------
    ------
    ------
    ------
    ------


    This array formula** entered in E2:

    =IFERROR(INDEX($A:$A,SMALL(IF($B$2:$B$10=$D2,ROW(B$2:B$10)),COLUMNS($E2:E2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down as needed then across until you get a column full of blanks.

  18. #18
    Registered User
    Join Date
    07-28-2008
    Location
    montreal
    Posts
    59

    Re: Just need a little help with simple vlookup

    Quote Originally Posted by Tony Valko View Post
    Like this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Secretary
    Consultant
    Consultant
    Secretary
    2
    Judy
    111
    111
    Judy
    Bill
    Sandy
    3
    Tina
    222
    222
    Tina
    4
    Linda
    333
    333
    Linda
    Eric
    5
    Bill
    111
    444
    Connie
    Tracy
    6
    Connie
    444
    555
    Tom
    7
    Tracy
    444
    8
    Tom
    555
    9
    Eric
    333
    10
    Sandy
    111
    11
    ------
    ------
    ------
    ------
    ------
    ------
    ------
    ------


    This array formula** entered in E2:

    =IFERROR(INDEX($A:$A,SMALL(IF($B$2:$B$10=$D2,ROW(B$2:B$10)),COLUMNS($E2:E2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down as needed then across until you get a column full of blanks.

    could you please give me an example with my template because when i try to transpose your formula to my template, i get a name but not the right one. It always shows me the name under the one that I want.

    thanks!

  19. #19
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Just need a little help with simple vlookup

    Here's a sample file...
    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)

Similar Threads

  1. [SOLVED] help with simple IF / VLOOKUP ?
    By HeyInKy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2015, 12:27 PM
  2. [SOLVED] Simple IF(VLOOKUP problem
    By Phrick in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2015, 08:39 AM
  3. I need help with a simple vlookup formula
    By phjohnso in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-21-2013, 06:11 PM
  4. Simple vlookup
    By geddes_3 in forum Excel General
    Replies: 2
    Last Post: 10-28-2011, 11:55 AM
  5. How To Do Simple Vlookup?
    By doozidoesit in forum Excel General
    Replies: 10
    Last Post: 03-30-2011, 06:56 PM
  6. Simple Vlookup?
    By ringrim in forum Excel General
    Replies: 1
    Last Post: 08-20-2008, 01:38 PM
  7. Simple VLOOKUP...
    By compulsiveguile in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-16-2008, 09:10 AM

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