+ Reply to Thread
Results 1 to 13 of 13

Returning data from a dropdown box using vlookup

Hybrid View

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    Urbana, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Returning data from a dropdown box using vlookup

    Ok cool. could you explain in the vlookup formula what the last few numbers are referring to?

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Returning data from a dropdown box using vlookup

    =VLOOKUP(A1,JobTable,MATCH(A5,Fields,0)+1,0)

    MATCH(A5,Fields,0)

    The 0 means to find an "exact" match of cell A5 (case is not a factor).

    MATCH(A5,Fields,0)+1

    The +1 is an "offset correction". The MATCH function will return a number from 1 to 3 but we need these numbers to be from 2 to 4 (the relative column numbers of the table).

    =VLOOKUP(A1,JobTable,MATCH(A5,Fields,0)+1,0)

    The 0 means to find an "exact" match of cell A1 (case is not a factor).
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    06-03-2013
    Location
    Urbana, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Returning data from a dropdown box using vlookup

    alright its not working for the actual database ive been buildng so Im going to attach another sample workbook that is much more direct of the design i have. Would you be able to construct the formula to make it work in this sample? I would greatly appreciate it.

    SampleWorkbook2.xlsx

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Returning data from a dropdown box using vlookup

    One thing you have to correct is the source for the drop down in cell A5.

    Excel won't allow you to use the names from the drop down in cell A2 because they are also valid cell references. For example, Job1 is a valid cell address (column JOB, row 1). When this happens Excel concatenates an underscore to the string:

    _Job1

    This tells Excel that the string is not a cell reference.

    So, for the drop down list source in cell A5 use:

    =INDIRECT("_"&A2)

    Ok, so what result are you looking for? Do you want to return the column headers based on the selections of the drop down lists?

    If I select Job2 in A2 and Person2 in A5 what result do you expect?

+ 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