Numbers for Mac: Index using 3 or more criteria

Hi All,


I am looking for a way to index using multiple criteria (Size, Mounting Type, Adjustability, Style, Finish). The function would return the part number for the item that meets all criteria. A second step would then be to find the price intersection of the returned part number and a selected finish. In excel there seems to be an array function that combines the index and match functions, but this does not seem to work in numbers.


Thanks so much for your help,

Ryan


Posted on Nov 24, 2019 2:29 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 27, 2019 5:47 AM

Hi Ryan,


Since you have row numbers down the left you can use SUMIFS (or AVERAGEIFS) to "calculate" the right row number from multiple criteria in a formula, like this:




In B9: =SUMIFS(Hardware List::A,Hardware List::F,B2,Hardware List::G,B3,Hardware List::H,B4,Hardware List::I,B5)

B10: =MATCH(B7,Hardware List::$2:$2,0)

B11: =INDEX(Hardware List::A$1:R$15,B9,B10,1)

B12: =INDEX(Hardware List::B,B9)


Note that:

--You don't need a concatenation key.

-- You can easily add/remove/change column-condition pairs within SUMIFS as needed if the structure of your Hardware List table changes.

-- You can look up the Part "Number" as shown, but you don't need that number to look up information.


The SUMIFS will come up with the correct result as long as you don't have more than one entry with the exact same attributes. That's because it will be "summing" only one number from column A.


BTW, obviously have to be take care to have exact spelling. The size on Row 7 is misspelled. One way to prevent misspelling is to format the cells as Pop-Up Menu.


SG



9 replies
Question marked as Top-ranking reply

Nov 27, 2019 5:47 AM in response to NBSD

Hi Ryan,


Since you have row numbers down the left you can use SUMIFS (or AVERAGEIFS) to "calculate" the right row number from multiple criteria in a formula, like this:




In B9: =SUMIFS(Hardware List::A,Hardware List::F,B2,Hardware List::G,B3,Hardware List::H,B4,Hardware List::I,B5)

B10: =MATCH(B7,Hardware List::$2:$2,0)

B11: =INDEX(Hardware List::A$1:R$15,B9,B10,1)

B12: =INDEX(Hardware List::B,B9)


Note that:

--You don't need a concatenation key.

-- You can easily add/remove/change column-condition pairs within SUMIFS as needed if the structure of your Hardware List table changes.

-- You can look up the Part "Number" as shown, but you don't need that number to look up information.


The SUMIFS will come up with the correct result as long as you don't have more than one entry with the exact same attributes. That's because it will be "summing" only one number from column A.


BTW, obviously have to be take care to have exact spelling. The size on Row 7 is misspelled. One way to prevent misspelling is to format the cells as Pop-Up Menu.


SG



Nov 24, 2019 3:48 PM in response to NBSD

I suggest adding a column called "Key" where you concatenate the three fields together.


the key on your case would be something like:

=E2&"_"&F2&"_"&G2&"_"&H2


I suggest making the key column the first column in your table.


then in the search table, enter the selections (hopefully from pop-up menus.


the search results can be obtained using the function vlookup (or lookup + index)


Nov 26, 2019 7:43 PM in response to NBSD

=MATCH(B5,Hardware Price List::Concatenatenation Key,0)

will give you the row number where it finds the exact match. In general it gives you the position of the found item in the range you are searching. You are searching the entire column so it equals the row number. The last parameter (the zero) specifies exact match.


=INDEX(Hardware Price List::Part Number,MATCH(B5,Hardware Price List::Concatenatenation Key,0))

will give you the part number.


You may choose to do individual INDEX(MATCH()) formulas for each column you want data from or you can do one MATCH to get the position and then use that number in several INDEX functions.

Nov 25, 2019 10:56 AM in response to NBSD

The LOOKUP function will return a close match if there is no exact match. You need to use VLOOKUP or use INDEX and MATCH together. VLOOKUP and MATCH allow you to specify exact match only. VLOOKUP requires your concatenated column to be somewhere to the left of the data you want to return. INDEX/MATCH does not require that.

Nov 25, 2019 9:09 AM in response to Wayne Contello

Wayne,


Thanks for the solution. Here is how I applied this idea. The issue that I am not running into is that some combinations of attributes are not present, however, when I index "Finish" and "Part Number" my formula will return a result even if the exact combination is not present. I imagine there is an easy fix for this.


Ryan

Nov 25, 2019 9:17 AM in response to Yellowbox

Hi Ian,


Thanks for your reply and questions.

  1. I have the first column and row numbered so that I can use an indexing function. I imagine that my solution as outlined in my response to Wayne's suggestion is a bit clunky. If you have a simpler solution I would welcome your suggestions.
  2. No, not every part number is available in every finish.
  3. See answer to question one.
  4. The prices are in columns 10-17


My intention here is to avoid having to list each part number and finish combination as a separate item. We update this price list regularly and this helps to streamline that process. The price list shown in my visual aids is just a small portion of our hardware list.

What would the structure of an index-match look like in numbers?


Ryan

Nov 25, 2019 2:36 AM in response to NBSD

Hi Ryan,


Welcome to Numbers for Mac!

Numbers has some ability with array functions, but Numbers is not a Excel clone.


Some questions:

  1. Do you need to label each column in Row 1 of the table "Hardware Price List" with a number? If not, you can delete Row 1.
  2. Is every part number available in every finish (Chrome, Brushed Nickel, Polished Nickel, Oil Rubbed Bronze, Brass, SatinBrass, Matte Black, Antique Brass)? If so, your table needs many more rows to hold every combination of Size, Mounting Type, Adjustability, Style, Finish before you can do a lookup or Index-Match. And, yes, Index-Match does work In Numbers if the table to search is designed that way.
  3. What is the purpose of the left column? Is that column A in a table?
  4. Where are the prices? Are the prices the values in columns 10-17 in your screen shot?


More information on your overall aim will lead to a solution!


Regards,

Ian.





This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Numbers for Mac: Index using 3 or more criteria

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.