How to Look Up with Two Criteria Using XLOOKUP in Excel
Match on two columns at once — branch and car class — by multiplying conditions or joining keys, then mix in a comparison.
You will learn to
- Look up with two conditions using (range=x)*(range=y)
- Use a joined key as an alternative
- Combine an exact condition with a ≥ condition
How it works
XLOOKUP looks for one value, but you can make that value represent several conditions. (A2:A11="Downtown")*(B2:B11="Compact") produces 1 only on rows where both are true, so =XLOOKUP(1,(A2:A11=G1)*(B2:B11=G2),C2:C11) returns the rate for that branch and class. No helper column is needed.
An alternative joins the keys: =XLOOKUP(G1&"|"&G2,A2:A11&"|"&B2:B11,D2:D11). The multiply method is more flexible because any condition works, including comparisons like D2:D11>=5 to find the first class with enough cars available.
=XLOOKUP(1,(A2:A11=G1)*(B2:B11=G2),C2:C11)