+ Reply to Thread
Results 1 to 5 of 5

How to find value in another table and return value from same row

  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    Isle of Wight
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to find value in another table and return value from same row

    Hi all

    This is my first post here so apolgies if I'm using the wrong sub-forum or anything like that.

    I really need some help with the following problem in Excel 2010.

    I have two vaery large tables of data:

    Table 1 is a long list of unique items in no particular order, each of which belongs to a unique group of items, for example:

    Items Group ID
    apple
    pear
    grape
    fig
    banana
    guava
    peach
    mango

    Table 2 lists all the Group ID numbers and in the same row as each Group ID number, shows the names of all the items belonging to that group, one item in each column. Different Groups have different numbers of items in them. For example:

    Group ID Item1 Item2 Item3 etc.
    214 apple pear grape
    33 fig
    7 banana guava
    59 peach mango

    Is there a formula I can use in the second column of Table 1 to look for each item in Table 2 and tell me what group it is in? For example for "apple" or "pear" or "grape" it would look in Table 2 and return the Group ID number "214".

    Hope I've explained that clearly and thanks in advance for any ideas.
    Last edited by jpearson01; 12-14-2012 at 01:50 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to find value in another table and return value from same row

    jpearson01,

    Welcome to the forum!
    Attached is an example workbook based on the criteria you described.
    Row 1 is used to show which table is which
    Row 2 is a header row so actual data starts in row 3
    Table 1 is in columns A and B
    Table 2 is in columns D:G

    In cell B3 and copied down is this array formula. Note that array formulas must be entered with Ctrl+Shift+Enter and not just Enter. That's how they get surrounded by the curly braces {}, do not try to add those yourself.
    Please Login or Register  to view this content.

    Also note that the Index range starts at D1. When doing a formula like this, I find it easiest to always have the index range start at row 1 regardless of where it actually is in the spreadsheet. Then ending row still ends where the actual data ends, in this case row 6.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: How to find value in another table and return value from same row

    You can also use UDF to reach your goal

    Please Login or Register  to view this content.
    Copy this code into VBE module
    1. Press Alt+F11
    2. Go toInsert > Module
    3. Copy and Paste code into module
    4. paste formula =MMATCH($A2,$F$2:$H$5,$E$2:$E$5) next to lookup values


    attachement avaliable
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  4. #4
    Registered User
    Join Date
    12-14-2012
    Location
    Isle of Wight
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to find value in another table and return value from same row

    tigeravatar That formula was exactly what I needed, thank you very much indeed. I see I'm going to have to do some homework on my Excel functions because I'm not exactly sure how your formula works. Can you recommend a good online explanation of / tutorial on array formulas (I've never come across those curly brackets and Ctrl+Shift+Enter before)?

    contaminated Thank you too for responding. I didn't actually test your solution because, (a) tigeravater already solved my issue, and (b) the VBE module is unknown and terrifying territory for me! It looks very elegant though.

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to find value in another table and return value from same row

    Can you recommend a good online explanation of / tutorial on array formulas (I've never come across those curly brackets and Ctrl+Shift+Enter before)?
    http://www.cpearson.com/excel/arrayformulas.aspx
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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