BBampaa

Lessons › Excel & Google Sheets

Excel & Google Sheets lesson

XLOOKUP

It finds Earbuds in the price list's Product column and brings back the price next to it.

Try this lesson free →
About 5–10 minutes · no sign-up needed

Example

The prices live in a separate table. XLOOKUP fetches the right one:

=XLOOKUP(B2,F2:F5,G2:G5)

Typed into cell D2 of this sheet:

OrderProductQtyPriceProductPriceLook upPrice
O101Earbuds2Earbuds35Charger
O102Charger1Charger15
O103Phone case3Phone case8
O104Screen guard4Screen guard5
O105Earbuds1

Key points

B2What to look for: this order's product.
F2:F5Where to look: the price list's Product column.
G2:G5What to bring back: the matching price.
Prices!A2:A5Another tab: cells A2 to A5 on the Prices tab. Most work files keep lists like this on a tab of their own.

Put together: =XLOOKUP(B2,F2:F5,G2:G5). What to look for, where to look, what to bring back. From another tab, add its name: Prices!A2:A5.

Practice

Try each one in your head first, then open the answer.

1. In D3, look up the price for order O102's product.
=XLOOKUP(B3,F2:F5,G2:G5)
2. In D4, look up the price for order O103.
=XLOOKUP(B4,F2:F5,G2:G5)
3. In D5, look up the price for order O104.
=XLOOKUP(B5,F2:F5,G2:G5)
4. In D2, look up the price for order O101.
=XLOOKUP(B2,F2:F5,G2:G5)
5. In I2, look up the price of whatever product is typed in H2.
=XLOOKUP(H2,F2:F5,G2:G5)

Learn it by doing. This lesson is a short hands-on level on Bampaa: see it work, then build and write it yourself, with instant feedback.

Try this lesson free →
About 5–10 minutes · no sign-up needed