+ Reply to Thread
Results 1 to 6 of 6

Index and Match array formula - Help with this?

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Index and Match array formula - Help with this?

    The goal is if Column B and C of ‘Practice’! matches column B and C of ‘HR’!, return the fair name from column D of ‘HR’!.

    =INDEX(HR!$B$2:$D$27079,MATCH(Practice!B2&C2,HR!$B$2:$B$27079&$C$2:$C$2709,0),4)

    I keep getting an error message.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Index and Match array formula - Help with this?

    Your formula is missing the sheet reference to your second range in the match, and you have to enter it as an array formula with Ctrl+Shift+Enter, instead of just hitting enter as normally.

    Also, if you're going to use the 4th column of that index, you can just specify D for the whole thing.

    =INDEX(HR!$D$2:$D$27079,MATCH(Practice!B2&C2,HR!$B$2:$B$27079&HR!$C$2:$C$2709,0))

    You can also use LOOKUP to avoid using an array formula altogether:

    =LOOKUP(2,1/((Practice!B2=HR!$B$2:$B$27079)*(C2=HR!$C$2:$C$2709)),HR!$D$2:$D$27079)
    Last edited by daffodil11; 03-24-2014 at 07:45 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Index and Match array formula - Help with this?

    Hi,

    A better way would be to use helper columns which concatenate columns B&C. Otherwise as an array formula. i.e. one you enter with Ctrl-Shift-Enter. For instance in Practice!D1 copied down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ..and don't forget the Ctrl-Shift-Enter
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  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: Index and Match array formula - Help with this?

    A couple of issues.

    First, range concatenation is inefficient, especially on large ranges.

    Not all of your ranges are the same size. The reference to column C goes down to row 2709 while all other references go down to row 27079.

    Is the lookup value supposed to be:

    Practice!B2 & Practce!C2

    Here's an example of how to do a multiple criteria lookup.

    Data Range
    A
    B
    C
    D
    E
    F
    G
    1
    Header1
    Header2
    Header3
    ------
    Lookup1
    Lookup2
    Result
    2
    1
    1
    Result1
    2
    3
    Result5
    3
    1
    2
    Result2
    4
    2
    1
    Result3
    5
    2
    2
    Result4
    6
    2
    3
    Result5
    7
    3
    1
    Result6
    8
    3
    2
    Result7
    9
    4
    1
    Result8
    10
    4
    2
    Result9


    This array formula** entered in G2:

    =INDEX(C2:C10,MATCH(F2,IF(A2:A10=E2,B2:B10),0))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    03-24-2014
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Index and Match array formula - Help with this?

    Thank you Tony! After a little tweaking and adjusting, it was ultimately your index formula that worked. I've now finished analyzing 1122 employee recorts against a 27079 record database. Whew! So glad I didn't have to do that manually.

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

    Re: Index and Match array formula - Help with this?

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  2. Replies: 3
    Last Post: 03-31-2013, 01:53 PM
  3. Index, Match, Min, If, And in one Array formula
    By Skybeau in forum Excel General
    Replies: 1
    Last Post: 07-18-2012, 01:03 AM
  4. Nested Match(index()) vs. Match() array formula.
    By GeneralDisarray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2011, 07:57 AM
  5. [SOLVED] Index and Match Array formula
    By Graham Haughs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-15-2006, 09:55 PM

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