+ Reply to Thread
Results 1 to 17 of 17

Vlookup error

  1. #1
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Question Vlookup error

    I have a combobox on cell d7 and is populated from a defined name list. This works fine

    What needs to happen is when i select a clients name from the combobox it should populate cells
    D8 with address
    D9 with Suburb
    D10 with Postcode
    D12 with Phone No
    D13 with Fax No
    D14 with Email Address

    I have inserted this formula in cell D8 =IF(A2="","",VLOOKUP(A1,Clients!$A:$G,2,FALSE))but can't get it to work

    All the clients details are in a worksheet called Clients within the same workbook in the following cells

    Cell A2 Clients Name
    Cell B2 Address
    Cell C2 Suburb
    Cell D2 Postcode
    Cell E2 Phone No
    Cell F2 Fax No
    Cell G Email Address

    I know once the formula is correct in cell D8 i copy it to the other cells and change the column numbers
    Last edited by Mooseman60; 12-05-2010 at 11:21 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Vlookup error

    Suspect it needs to be:

    ... VLOOKUP(A2,Clients!$ ...

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Vlookup error

    Change your column reference to the same as below and you'll be able to drag down and the column number will increment, it'll save you having to maniually change each formula VLOOKUP(A1,Clients!$A:$G,Rows(D$8:D8)+1,FALSE)
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  4. #4
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    I have inserted the following code in cell D8 as suggested but it isn't populating cells D8, D9, D11,D12, D13


    Please Login or Register  to view this content.
    Any suggestions

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Vlookup error

    Didn't read the question properly last time; your client's name is in cell D7

    Change it to:

    ... VLOOKUP(D7,Clients!$ ...

    Regards
    Last edited by TMS; 12-05-2010 at 05:18 AM.

  6. #6
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    Ok i have inserted the following formula in D8 but still get nothing

    Please Login or Register  to view this content.
    D8 D9 D11 D12 D13 D14 are all dependent on Combobox selection in D7

    When I select item in combobox the abovementioned cells are still blank

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Vlookup error

    You are only looking in one row with that version and asking for the value in Col B.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup error

    IF($D$7="","",VLOOKUP($D$7,Clients!$A$1:$G$1000,2,FALSE)
    or if your combobox linked cell is a2
    then
    IF($A$2="","",VLOOKUP($A$2,Clients!$A$1:$G$1000,2,FALSE)
    Last edited by martindwilson; 12-05-2010 at 09:36 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    I have pasted the formula in Cell D8 but it actually displays the code in the cell as well as the formula bar why is this happening

    IF($A$2="","",VLOOKUP($A$2,Clients!$A$1:$G$2,2,FALSE)

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Vlookup error

    There is no = sign in front of the IF

    And you are still searching only two rows by using Clients!$A$1:$G$2

  11. #11
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    I have placed the = sign in front of the If and this has hidden the formula in D7

    This is what should be happening but is not working

    If I select a Clients name from the combobox in D7 the lookup should populate Cell D8 with Address Cell D9 with Postcode Cell 11 with Phone No Cell 12 with Fax No Cell 13 with Email Address

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup error

    look at this
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    Not sure why your formula is showing name in Cell A2

    I have attached my workbook so you can see what i am trying to achieve. I dont understabd why its not working as I had it working a couple of days ago
    Attached Files Attached Files

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Vlookup error

    D8: =IF($D$7="","",VLOOKUP($D$7,Clients!$A:$G,ROW()-6,FALSE))

    and drag down to D13

    Just goes to show how valuable a sample workbook is ;-)

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup error

    have a combobox on cell d7
    no you don't!!!!!
    you have a data validation drop down not the same thing as a combobox which i showed in my example
    id prefer in d8
    D8: =IF($D$7="","",VLOOKUP($D$7,Clients!$A1:$G1000,ROW(a2),FALSE))
    dragged down then delete D10
    Last edited by martindwilson; 12-05-2010 at 11:18 AM.

  16. #16
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    Thanks very much that works perfectly

  17. #17
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Vlookup error

    Sorry for the wrong description of the drop down box and thanks for your help its much appreciated

+ 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