+ Reply to Thread
Results 1 to 12 of 12

Vlookup issues

  1. #1
    Registered User
    Join Date
    06-29-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    9

    Vlookup issues

    I am trying to find a simple and sweet solution to a vlookup issue. I have several states and individual counties listed under those states. Lists are driven by indirect so only those counties that apply to the state are available.

    So.. I know what state is selected.. I know that the county selected is only available for that state. I then have another column of data that I need to retrieve based on the county and I have labeled each state/county data.. For example I have Highlighted all the counties in GA listed in column A and the response I want in Column B and labeled the table_array GA_1... Each state table is listed the same with the State_1.

    Is it possible to list multiple tables in a vlookup? =vlookup(county selected, GA_1 or TX_1 or FL_1, 2)?? Is it possible to reference a cell that has a label based on inputs? Cell B2 =concatenate(state abbr,"_1)... then have vlookup(county selected, B2,2)?? I tried this and it doesnt input as a label but as a cell reference. Is there a way to tell the formula that the content of the cell is a data label? I would like to avoid having to do a macro.. Thanks in advance
    Last edited by rhuark; 06-30-2011 at 01:35 PM. Reason: Solved

  2. #2
    Registered User
    Join Date
    06-29-2011
    Location
    Nottingham
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Vlookup issues

    Have a look at this thread:
    http://www.excelforum.com/excel-gene...-function.html

    Quote Originally Posted by daddylonglegs View Post
    =VLOOKUP("x",CHOOSE({1,2},D2:D10,A2:A10),2,0)
    Looks like what you're after.

  3. #3
    Registered User
    Join Date
    06-29-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Vlookup issues

    Unfortunatly this is wont for for me. where they show D2:D10,A2:A10.. My single table is A2:B10, next table C2:D10, E2:F10 and so on.. Each table cosists of counties in the column to the left with the referenced item I am looking for in the next column.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup issues

    Can you attach a sample workbook?
    HTH
    Regards, Jeff

  5. #5
    Registered User
    Join Date
    06-29-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Vlookup issues

    Example attached.. First sheet is a generic static example of response to be used, second sheet or datatable has the several tables to skim through. Table one is named GA_1, Next Table TX_1.. the other tables are not labeled for this example.

    Thank you in advance for any help.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup issues

    No attachment

  7. #7
    Registered User
    Join Date
    06-29-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Vlookup issues

    I hope it worked this time.
    Attached Files Attached Files

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup issues

    In B9 use =VLOOKUP(B7,INDIRECT(B5),2,0)

    but first you need to change the scope of your named range to workbook instead of worksheet

    I would also suggest removing B5 the table array and just using the state abbreviation as the named range.

  9. #9
    Registered User
    Join Date
    06-29-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Vlookup issues

    Jeff - thank you for the input but I have not yet fully grasped the indirect fuction. could you apply it as you discussed to the example and repost?

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup issues

    No problem.

    I only did two examples, GA and TX, but hopefully from this example you can follow the rest.

    B3 >> select the state
    B6 >> returns the table array -- named range
    B9 >> using indirect the names are returned
    B12 >> =IFERROR(VLOOKUP(B9,INDIRECT(B6),2,0),"")

    Now when you change a state in B3, B9 is cleared and ready for the next input. Try TX now.

    Note: You must enable macros

    This link will explain the indirect better than I can...
    http://www.contextures.com/xlFunctions05.html
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-29-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Vlookup issues

    Jeff = the man. That worked fantastic.. I wish I could read some of this and visualize it but it always goes back to having a working model.

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup issues

    I agree...I am the same way...need something to see Gald it worked for you

    Don't forget to mark as solved if this satisfies your query.

+ 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