Lookup with Multiple Criteria
Premiumintermediate 15 min5 tasks0/78 pts
Sometimes one column is not enough to find a row. A Hoodie comes in S, M and L, so you need product and size together. In older Excel you build a helper column that joins the two (=B2&C2) and look that up with VLOOKUP. In Excel 365 you can join the columns inside the formula: XLOOKUP(G1&G2, B2:B8&C2:C8, D2:D8). For numbers, SUMIFS with two conditions gives the same answer.
Syntax
XLOOKUP(value1&value2, range1&range2, return_range) · INDEX(return, MATCH(1, (range1=value1)*(range2=value2), 0))
Example: =XLOOKUP("Hoodie"&"M",A2:A8&B2:B8,C2:C8) joins each row into a key such as HoodieM and returns the matching price.
Common mistakes
- Putting the helper column to the right of the data, where VLOOKUP cannot see it as the first column.
- Joining the lookup values in a different order from the helper column (MHoodie vs HoodieM).
- Using SUMIFS on text results: it only adds numbers.
Read the lesson, then try it yourself in a live spreadsheet.