Q: Multiple criteria in numbers
I need to search or lookup based on criteria from 2 columns and return the corresponding value from a 3rd column. It seems like such a simple task, yet I cannot find anything that works.
There are similar paper names, but different sizes. I want to look up the paper name, and then paper size and have the price returned by the formula.
MacBook Pro (Retina, 15-inch, Mid 2014), iOS 10
Posted on Sep 25, 2016 10:04 PM
The difficulty with this arrangement is that the lookup functions (including MATCH) can handle only one search value, and return the result from the first instance of that value they find.
The example provided above gets around that limitation by placing the data to be retrieved at the intersection of a column and a row, each headed by one of the two chosen specifications.
To do the search on the table in your example, it's necessary to add a column where the two (or more) search values are combined to form a single specification that will apply to only one row on the table.
Here's an example, with the search value constructed in column K, which may be hidden.
You'll notice that I have placed the lookup function on a separate table. This allows specifying the whole of columns K and J on Table 1 (the top one) as the search range and return value range in the LOOKUP formula below.
Table 1 contains a single formula, entered in K2, and filled down to the last row of the table.
K2: =B&F
The formula retrieves the values from 'this row' of columns B and F, and concatenates them into a single text string.
Table 2 (bottom) contains two formulas:
K2: same as the formula at this location on Table 1.
I2: =LOOKUP(K2,Table 1::K,Table 1::I)
Gets the text value from K2 on 'this table, looks for it in column K of Table 1, and returns the value from the cell in column J of Table 1 on the row where the formula finds the search value.
Both formulas are filled down to the next row, allowing comparison of two choices.
Regards,
Barry
Posted on Sep 26, 2016 12:07 AM


