+ Reply to Thread
Results 1 to 9 of 9

Vlookup assistance

  1. #1
    Registered User
    Join Date
    01-11-2011
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    21

    Vlookup assistance

    If you look at the example sheet I have, it will return the address for the name entered into A2. What I would like is to be able to just type in the first name and have it return the address as if I had typed in the whole name. Is this possible?
    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 assistance

    What if there are multiple people with the same first name?

    Have you considered using a data validation drop down list so that the user can just pick a name from the list: Data Validation Intro
    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
    01-11-2011
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    21

    Re: Vlookup assistance

    Quote Originally Posted by NBVC View Post
    What if there are multiple people with the same first name?

    Have you considered using a data validation drop down list so that the user can just pick a name from the list: Data Validation Intro
    There will no be duplicate names as this is just a mock up of what I'm doing. The first word in the "name" field will be unique to that entry. I was originally going to go with the Data Val List, but found it take more time sorting through 300 unique "names" than just typing it the first part of the entry. If there is no other way to do it I may have to use the data validation list.

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

    Re: Vlookup assistance

    Well you can use a wildcard in the Vlookup, i.e. VLOOKUP(A2&"*",Ref!$A$1:$C$5,2,FALSE)

    this will look to see if anything in column A of the Ref! table starts with name in A2...

  5. #5
    Registered User
    Join Date
    01-11-2011
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    21

    Re: Vlookup assistance

    Quote Originally Posted by NBVC View Post
    Well you can use a wildcard in the Vlookup, i.e. VLOOKUP(A2&"*",Ref!$A$1:$C$5,2,FALSE)

    this will look to see if anything in column A of the Ref! table starts with name in A2...
    Ok great that is a start to what I want....the problem is if I leave it blank it pulls in the first address off the list. I am assuming I can remedy this by taking by list worksheet and putting a blank entry at the top.

    EDIT*
    Ok adding a blank line didnt work. How can I get it to show blanks on the address line if the entry line is also blank?
    Last edited by liverebel; 06-08-2011 at 02:21 PM.

  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 assistance

    You could do:

    =IF(A2="","",VLOOKUP(A2&"*",Ref!$A$1:$C$5,2,FALSE))

    you could also nest your error trap formula in place of the simple VLOOKUP

  7. #7
    Registered User
    Join Date
    01-11-2011
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    21

    Re: Vlookup assistance

    Quote Originally Posted by NBVC View Post
    You could do:

    =IF(A2="","",VLOOKUP(A2&"*",Ref!$A$1:$C$5,2,FALSE))

    you could also nest your error trap formula in place of the simple VLOOKUP
    Hmm this looks great, but it keeps returning an error and I dont see why?

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

    Re: Vlookup assistance

    Please see attached.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Vlookup assistance

    Also, try

    main sheet A3, copy down

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",VLOOKUP(A$2&"*",Ref!$A:$C,ROWS(A$3:A3)+1,0)))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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