+ Reply to Thread
Results 1 to 19 of 19

Index Match Question

  1. #1
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Index Match Question

    Hi All,

    I have an Index Match question. I would like to add additional lookups within the Index array. I thought the best way to do this was the following with the following formula:

    =Index(array,Match(And(logic 1, logic 2), And(Array logic 1, array logic 2),0),# of columns)

    However this isn't returning results just the #VALUE!

    Any thoughts?

    Thanks,

    JP
    Last edited by CharterJP; 07-18-2013 at 11:12 AM.

  2. #2
    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 Match Question

    Hi,

    You'll need to upload the workbook. Manually add the results you expect and explain how you've arrived at them.
    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.

  3. #3
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Index Match Question

    Quote Originally Posted by CharterJP View Post
    ...the following formula:

    =Index(array,Match(And(logic 1, logic 2), And(Array logic 1, array logic 2),0),# of columns)

    However this isn't returning results just the #VALUE!

    ...
    Select the cell with formula. When it eveluates to an error, there should be "an exclamation mark in diamond" drop down beside the cell. Click on it and choose Show Calculation Steps... This usually shows the step just before final evaluation to an error result. Its meaningless if if its a multistep formula, so click on Evaluate then Restart. This will step into the calculation of the formula.... you'll figure the rest out.

    Anyway, your AND functions within Match evaluate to TRUE or FALSE. While you could want to match TRUE or FALSE (though I'm doubting this is your current purpose), these will not point to an 1D array as the second argument... likely where the error starts, then cascades through the formula evalution.

  4. #4
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Here is an example of what I am trying to do and the expected results.
    Attached Files Attached Files

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

    Re: Index Match Question

    In b4 use this array formula

    =INDEX(Data!$A$2:$D$30,MATCH($B$1&$A4,Data!$A$2:$A$30&Data!$B$2:$B$30,0), MATCH(B$3,Data!$A$1:$D$1,0))

    Confirm with Ctrl+Shift+Enter and not just Enter

    Copy down and across
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Thank you Ace_XL for your reply. However, I could not get the formula to return the expected results. Could you provide more detail??

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

    Re: Index Match Question

    Try this...

    In A2 enter this label: # of Records

    Enter this formula in B2:

    =COUNTIF(Data!A:A,B1)

    Enter this array formula** in B4:

    =IF(ROWS(B$4:B4)>$B$2,"",INDEX(Data!C$2:C$30,MATCH(1,IF(Data!$A$2:$A$30=$B$1,IF(Data!$B$2:$B$30=$A4,1)),0)))

    Copy across to C4 then down to B14:C14.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Index Match Question

    Enclose the formula in IFERROR to avoid #N/A

    See attached..
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Hi Tony,

    Interesting approach. I didn't think of adding a number of records to the form. However, I am getting a #N/A as a result for B and C. As I change the Value in B1 I can see the formula working however, the #N/A returns for the results exected for each B and C based on the number of roles each have

  10. #10
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Ace,

    Quick Question, You have the {} brackets before and after your formulas. However, when I add these to mine, it Nulls the formula. Why?

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

    Re: Index Match Question

    Here's your file with the formulas implemented:

    Multi Index Match Lookup Example(1).xlsx

    Make sure you enter the formula in B4 as an array formula.

    Array formulas are entered differently than a regular formula.
    After you type in a regular formula you hit the ENTER key.
    With an array formula you *must* use a combination of keys.
    Those keys are the CTRL key, the SHIFT key and the ENTER key.
    That is, hold down both the CTRL key and the SHIFT key then
    hit the ENTER key.

    When done properly Excel will enclose the formula in squiggly
    brackets { }. You can't just type these brackets in, you
    *must* use the key combo to produce them. Also, anytime
    you edit an array formula it *must* be re-entered as an
    array using the key combo.

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

    Re: Index Match Question

    Quote Originally Posted by CharterJP View Post
    Ace,

    Quick Question, You have the {} brackets before and after your formulas. However, when I add these to mine, it Nulls the formula. Why?
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

  13. #13
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Tony, thank you for the detailed explanation. I had no idea. I will give it a shot. You guys have been very helpful! I've learned something new today

  14. #14
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Success! Ace and Tony... Thank you so much again!

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

    Re: Index Match Question

    Quote Originally Posted by Ace_XL View Post
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Not necessarily.

    http://www.excelforum.com/suggestion...naccurate.html

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

    Re: Index Match Question

    See this for more info on array formulas:

    http://www.cpearson.com/Excel/ArrayFormulas.aspx

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

    Re: Index Match Question

    You're welcome. Thanks for the feedback!

  18. #18
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Index Match Question

    Can you add this functionality within a LIST data validation?

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

    Re: Index Match Question

    Yes, you would use one of the data ranges as the source for the drop down list.

    You would need to use a dynamic range since not all the Names have the same amount of data.

    Where do you want the drop down list to appear and what data should be used as the selections for the drop down list?

+ 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. Index, match, match Question!. Seems so simple but can't figure it out...
    By huikimhuikim in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 01:57 PM
  2. Index/Match Question
    By mikera in forum Excel General
    Replies: 2
    Last Post: 01-07-2010, 07:01 PM
  3. [SOLVED] Index/Match question Need help!
    By Brian H in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-10-2005, 09:05 PM
  4. Match or Index Question
    By carl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2005, 05:05 PM
  5. Match + Index(?) Question
    By KemS in forum Excel General
    Replies: 2
    Last Post: 03-30-2005, 10:25 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