TopicsCheat sheetLessons
Lurndo › Excel › XLOOKUP

Learning Excel: XLOOKUP

Looking up in any direction

On the delivery slips Kyle wants the customer's name, and that's to the left of the code. VLOOKUP can't reach it. XLOOKUP can, and it also knows what to do with a customer who isn't on the list yet.

XLOOKUP

XLOOKUP takes two separate ranges: where you search and where you take the answer from. So it doesn't matter whether the answer is to the left or to the right.

In I2, =XLOOKUP(B2,L2:L6,K2:K6) looks for the code K03 in L2:L6 and takes the name in the same place in K2:K6: Cygnet Café.

I2
fx

=XLOOKUP(B2,L2:L6,K2:K6)

ABCDEFGHIJKLMNOPQ
1RideCustomerZoneKmWeightPriceAreaSurchargeCustomer nameNameCodeAreaFrom kmPrice
2R01K03Centre2.53Cygnet CaféBloom BakeryK01Manchester0£6.00
3R02K01Suburbs7.212Book NookK02Burnage3£9.00
4R03K05Docks11.425Cygnet CaféK03Manchester6£12.00
5R04K02Centre1.81Dot PrintK04Didsbury10£18.00
6R05K03Suburbs5.58Fork & SpokeK05Withington
7R06K04Docks9.918
8R07K01Centre34
9R08K02Suburbs610ZoneCentreSuburbsDocks
10R09K05Docks1430Surcharge£0.00£2.00£5.00
11R10K06Centre4.22
12
13PositionWeightCentreSuburbsDocksClassMedium
14Light£0.00£1.00£3.00ZoneDocks
15Medium£2.00£3.00£5.00Result
16Heavy£4.00£6.00£8.00
17

When nothing turns up

Customer K06 of ride R10 isn't on the list yet, so XLOOKUP gives #N/A for that ride.

A fourth argument says what should appear when nothing is found: =XLOOKUP(B11,L2:L6,K2:K6,"New customer").

I11
fx

=XLOOKUP(B11,L2:L6,K2:K6,"New customer")

ABCDEFGHIJKLMNOPQ
1RideCustomerZoneKmWeightPriceAreaSurchargeCustomer nameNameCodeAreaFrom kmPrice
2R01K03Centre2.53Bloom BakeryK01Manchester0£6.00
3R02K01Suburbs7.212Book NookK02Burnage3£9.00
4R03K05Docks11.425Cygnet CaféK03Manchester6£12.00
5R04K02Centre1.81Dot PrintK04Didsbury10£18.00
6R05K03Suburbs5.58Fork & SpokeK05Withington
7R06K04Docks9.918
8R07K01Centre34
9R08K02Suburbs610ZoneCentreSuburbsDocks
10R09K05Docks1430Surcharge£0.00£2.00£5.00
11R10K06Centre4.22New customer
12
13PositionWeightCentreSuburbsDocksClassMedium
14Light£0.00£1.00£3.00ZoneDocks
15Medium£2.00£3.00£5.00Result
16Heavy£4.00£6.00£8.00
17

Try it yourself

Who is the customer of ride R02? Look up the name in I3.

ABCDEFGHIJKLMNOPQ
1RideCustomerZoneKmWeightPriceAreaSurchargeCustomer nameNameCodeAreaFrom kmPrice
2R01K03Centre2.53Bloom BakeryK01Manchester0£6.00
3R02K01Suburbs7.212Book NookK02Burnage3£9.00
4R03K05Docks11.425Cygnet CaféK03Manchester6£12.00
5R04K02Centre1.81Dot PrintK04Didsbury10£18.00
6R05K03Suburbs5.58Fork & SpokeK05Withington
7R06K04Docks9.918
8R07K01Centre34
9R08K02Suburbs610ZoneCentreSuburbsDocks
10R09K05Docks1430Surcharge£0.00£2.00£5.00
11R10K06Centre4.22
12
13PositionWeightCentreSuburbsDocksClassMedium
14Light£0.00£1.00£3.00ZoneDocks
15Medium£2.00£3.00£5.00Result
16Heavy£4.00£6.00£8.00
17
I3

Ready for more?

The full lesson has 5 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson
← PreviousLooking up in a rowNext →Which position?

SQL

  • Topics
  • All lessons
  • Cheat sheet

Excel

  • Topics
  • All lessons
  • Shortcuts

HTML & CSS

  • About the course
  • All lessons

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Privacy
Nederlands