+ Reply to Thread
Results 1 to 9 of 9

Lookup more than one table,depending on user input

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Lookup more than one table,depending on user input

    Hi,
    can someone assist me...

    i want to be able to select a "version" that looks at the fault code table, and selects the correct code description for that version.
    At the moment i am using 2 columns to do what i want, but what is a better way. I may need to expand on the version codes, so this needs to be included also in the answer.

    im using vlookup at the moment, but if the formula is changed, can someone explain

    please see attachement...

    Many thanks
    Attached Files Attached Files
    Last edited by interested; 07-24-2012 at 02:45 AM.

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Lookup more than one table,depending on user input

    G'day

    Basically you need to make your 'table_array' in the vlookup formula dynamic.

    With your tables ranges already named I added a helper columns to make the selection name in 'Version' more user friendly.

    See attached.
    Attached Files Attached Files
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Lookup more than one table,depending on user input

    Thanks mate !!! so does the indirect funtion make the lookup dynamic?

    i've never used that function before

    this will help me a lot

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Lookup more than one table,depending on user input

    Another method, without the helper columns, but reliant on your tables following the order of the version list:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Steve D. a.k.a. Stephen Dunn

  5. #5
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Lookup more than one table,depending on user input

    Ratcat: now i copy the formula into my workbook i cant get it to see "code". i have created it in the list but cant seem to get it to work.

    Stunn : thanks for your contribution, but my excel aint that good to understand your formula,

    i have attached the real document, so is it possible you both can modify it to work, then i can follow the formula

    Thank you both again......
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-16-2012
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Lookup more than one table,depending on user input

    Put this in K2 and copy downward:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-20-2011
    Location
    lancashire,England
    MS-Off Ver
    Excel 2013
    Posts
    187

    Re: Lookup more than one table,depending on user input

    Thanks Stunn....it works for me, but i dont know how??? i just added another failure column in too and its perfect. thanks

    ---------- Post added at 02:19 PM ---------- Previous post was at 02:08 PM ----------

    Thanks Stunn....it works for me, but i dont know how??? i just added another failure column in too and its perfect. thanks

  8. #8
    Registered User
    Join Date
    07-16-2012
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Lookup more than one table,depending on user input

    You're welcome. Think of it as a normal VLOOKUP, but the OFFSET does exactly what it says, it offsets the reference by a given amount of rows or columns (you can also change height and width but that isn't necessary here). So, for instance, the original reference given to OFFSET is product_fail_codes (your first table). If $F2 is blank, the IF returns 0 because we don't want any offset, instead we want it to stick to the original reference, however, if there is a value in $F2 we look it up in the version table. In the case of Iguana, the MATCH returns 2 because Iguana is in the second cell within the version table. Now we need to translate that to an offset that matches the positions of your tables. Since the first column of each table is 3 columns away from the previous one we need to multiply by 3 and then subtract 3 to get the correct position, it could equally have been (MATCH(...)-1)*3

  9. #9
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Lookup more than one table,depending on user input

    Quote Originally Posted by interested View Post
    Ratcat: now i copy the formula into my workbook i cant get it to see "code". i have created it in the list but cant seem to get it to work............
    It appears that this thread is solved. If I'm right please mark the thread accordingly.

    But to answer the "i cant get it to see "code" question.

    What I have done is named the table_array in the vlookup.

    Click in the link for some background info. http://www.contextures.com/xlNames01.html

    And thanks to stunn for there contribution

    Cheers

+ 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