+ Reply to Thread
Results 1 to 15 of 15

VLOOKUP Problem

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

    Question VLOOKUP Problem

    I am having problems with the VLOOKUP in my workbook

    I can select one category and it inserts the information into the respective cells

    When i select the another category it only fills in one cell

    I believe the problem is that the table array is not changing

    I have attached my workbook for you to see what the problem is, any help would be greatly appreciated
    Attached Files Attached Files
    Last edited by Mooseman60; 12-04-2010 at 04:53 AM. Reason: Solved Problem

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VLOOKUP Problem

    You could use Indirect like this in F23: =IF(D23="","",VLOOKUP(D23,INDIRECT(C23&"Lookup"),2,FALSE))

    Beware that Indirect is a volatile function though so extensive use can have performance issues.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

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

    Re: VLOOKUP Problem

    Domski

    That solved the problem thanks very much for your help

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

    Unhappy Re: VLOOKUP Problem

    I have another problem now. Instead of having all the data on one worksheet I have created separate worksheets for each category but now I can't get the second combobox to populate I have attached the updated workbook
    Attached Files Attached Files

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VLOOKUP Problem

    Your source for the data validation needs to be: =INDIRECT(C20&"List")

    Dom

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

    Re: VLOOKUP Problem

    Dom

    Where exactly do I paste this formula as I tried it in the formula below but it didn't work

    =IF(D20="","",VLOOKUP(D20,INDIRECT(C20&"List"),2,FALSE))

  7. #7
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VLOOKUP Problem

    You are using dependant data validation based on the value selected in column C so you need to change the source of that, not the vlookup formula.

    Dom

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

    Re: VLOOKUP Problem

    Dom
    I'm not getting what you mean. Can you give me a step by step guide to what i need to do and where

  9. #9
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VLOOKUP Problem

    If you select D20 and go to Data...Validation you will see that you currently have it set to allow a list with the source as =INDIRECT(C20). This is looking for a named range of the value selected in C20 to use as a source for the validation list. As your list for Roofing is called RoofingList you need to have the formula for the source as =INDIRECT(C20&"List")

    Dom

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

    Re: VLOOKUP Problem

    Dom

    Thank you very much for that it works great and also for your patience. I am new to this side of Excel

  11. #11
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VLOOKUP Problem

    One last point, as named ranges can't have spaced in the name you'll need to name the source for Box Gutters as something like Box_GuttersList. You data validation source will then need to be: =INDIRECT(SUBSTITUTE(C20," ","_")&"List")

    Dom

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

    Re: VLOOKUP Problem

    Dom

    It still have a couple of problems when i select box gutters it only populates the product combo box and also if I select Zincalume Flashings it doesn't populate the combobox at all
    I have attached workbook again
    Attached Files Attached Files

  13. #13
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VLOOKUP Problem

    Your named ranges for your lookups need to have a _ in then rather than just removing the spaces and the formula should be =IF(D20="","",VLOOKUP(D20,INDIRECT(SUBSTITUTE(C20," ","")&"Lookup"),2,FALSE))

    To be honest I'm a bit confused by the zincalume flashings bit. As the =INDIRECT(SUBSTITUTE(C20," ","_")&"List") works fine for the shorter names I can only guess that there is a limit on the length of the defined name allowed for a data validation source. Either that or I'm missing something really obvious.

    Dom

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

    Exclamation Re: VLOOKUP Problems Still

    I am having problems getting the first combobox to populate the second combo box which then populates 3 other cells It works fine on one selection in the first combobox but not other selections

    I have attached my workbook to show you whats happening
    Attached Files Attached Files

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

    Re: VLOOKUP Problems Still

    I managed to solve the problem. The defined name lists and lookups cannot have spaces or underscores in them

+ 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