+ Reply to Thread
Results 1 to 9 of 9

Thread: VLOOKUP with multiple fields

  1. #1
    Registered User
    Join Date
    09-21-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    10

    Unhappy VLOOKUP with multiple fields

    I have a list of customers on one sheet (Customer List) and I am trying to make a quick search page (Customer Search) to gather all the customers details on a different sheet,

    I am attempting to do a VLOOKUP for the First Name and Last Name fields so that when I enter the details all the other fields on the search page are automatically filled in but what I am trying does not seem to working.

    Also is there anyway to have a drop down list, some sort of validation I think, in place of the first name and last name fields on the search sheet with all the customers names and company (merging the 3 columns on the customer list sheet) and then using that for the lookup???

    So I am a bit stuck right now, any ideas would be a BIG help

    Thanks!

    I have attached what I have managed to get to so far
    Attached Files Attached Files
    Last edited by JulianCR; 09-21-2010 at 02:16 PM.

  2. #2
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,589

    Re: VLOOKUP with multiple fields

    Hi Jullian

    Welcome to the forum.

    One way would be to add a helper column to your sheet "Customer List", I have added a new column to the beginning.This column can be hidden.

    In this new column A in this case
    In A6
    =B6&", "&C6& " -" &D6
    Drag fill down as required

    Sort your data with this column as priority.

    Give this Range a name, I have called it "Concat"

    Use this name as a validation list in say cell E13 on sheet "Customer List"

    Then refer to this cell in your Vlookup

    eg in sheet "Customer List" B4
    =VLOOKUP($E$13,'Customer List'!$A$6:$L$368,2,FALSE)
    Returns Last name

    To see it work, select from the dropdown in sheet "Customer List" E13

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  3. #3
    Registered User
    Join Date
    09-21-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: VLOOKUP with multiple fields

    Marcol,

    Brilliant Work, really helped me out. I might just be being thick for this bit but is there a way that the "Concat" range will expand along with the main list if I hide the field without having to go in each time and editing the range???

    Thanks big time for the fix for the main problem

  4. #4
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,589

    Re: VLOOKUP with multiple fields

    Yes
    Make the named range Dynamic.

    With the example workbook

    In the Names Manager select "Concat" then in the Refers to:= field delete the existing entry then paste this
    ='Customer List'!$A$6:INDEX('Customer List'!$A:$A,COUNTA('Customer List'!$A:$A)+5)
    Don't put anything else in this helper column, just drag the formula in it down to suit your table, the validation list will automatically update.

    Hope this helps
    Last edited by Marcol; 09-21-2010 at 12:43 PM. Reason: Error in formula
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  5. #5
    Registered User
    Join Date
    09-21-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: VLOOKUP with multiple fields

    Sorry I don't think I explained it properly,

    If the helper column is hidden, is there a way of making the formula apply automatically on this column or a way of hiding empty fields, so that when you go to the validation drop box on the customer search sheet, you do not get all the , - , - , -
    for when there are no current values (but the formula is in place), can those values be hidden until a entry in made in the same row within the main table. As ultimately I will not be the only user using the table

    But the dynamic range will help anyway with the tables =)

    Thanks again, sorry for the misunderstanding

  6. #6
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,589

    Re: VLOOKUP with multiple fields

    Try this formula in sheet "Customer List", A6
    =IF(COUNTA(B6:D6)>0,B6&", "&C6&" -"&D6,"")
    Fill down as required.

    It will give you a number of blank rows at the end the dropdown but it will not affect the results.

    If this doesn't suit then things will become a little more complicated, I have a formula for the names range somewhere to cover this possibility, just need time to find it.

    You will however still need this formula.

    Cheers.

  7. #7
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,589

    Re: VLOOKUP with multiple fields

    Okay try this in addition to the last post

    Change the Named Range formula to this
    =OFFSET('Customer List'!$A$6,0,0,MATCH("*",'Customer List'!$A:$A,-1)-5,1)
    Hope this helps
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  8. #8
    Registered User
    Join Date
    09-21-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: VLOOKUP with multiple fields

    Marcol,

    This is incredible, really good work, could not of asked it to be any better

    I will be sure to mention your name once the system is finished :P

    Thanks Again

  9. #9
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,589

    Re: VLOOKUP with multiple fields

    Glad to have helped
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0