TopicsCheat sheetLessons
Lurndo › Excel › Approximate match

Learning Excel: Approximate match

Price bands

The price of a ride depends on the distance: a fixed amount up to 3 km, then one band higher each time. There's no row for 7.2 km in the table, and yet VLOOKUP has to find a price.

Approximate match

P2:Q5 holds the price bands: from 0 km a ride costs £6, from 3 km £9, and so on.

With TRUE as the last argument, VLOOKUP doesn't look for an exact match, but takes the largest value that isn't greater than what you're looking for. =VLOOKUP(D2,P2:Q5,2,TRUE) looks for 2.5 km, finds the band from 0 and gives £6.

F2
fx

=VLOOKUP(D2,P2:Q5,2,TRUE)

ABCDEFGHIJKLMNOPQ
1RideCustomerZoneKmWeightPriceAreaSurchargeCustomer nameNameCodeAreaFrom kmPrice
2R01K03Centre2.53£6.00Bloom 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

Try it yourself

Ride R06 is 9.9 km. Work out the price in F7.

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
F7

Ready for more?

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

Start the lesson
← PreviousLooking up in a columnNext →Looking up in a row

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