4.9 Approximate Lookup: Delivery Fee Slabs
Quick-commerce apps charge a delivery fee based on order value. Here is a fictional slab table FeeSlabs (sorted ascending on Min Order):
| Min Order (₹) | Fee (₹) | Meaning |
|---|---|---|
| 0 | 30 | Orders below ₹99 |
| 99 | 25 | ₹99 – ₹198 |
| 199 | 15 | ₹199 – ₹498 |
| 499 | 0 | Free delivery from ₹499 |
Three ways to get the fee for Amount in G2:
=VLOOKUP(G2, FeeSlabs!$A$2:$B$5, 2, TRUE)
=INDEX(FeeSlabs!$B$2:$B$5, MATCH(G2, FeeSlabs!$A$2:$A$5, 1))
=XLOOKUP(G2, FeeSlabs!$A$2:$A$5, FeeSlabs!$B$2:$B$5, , -1)
| Amount | Fee |
|---|---|
| ₹64 | ₹30 |
| ₹150 | ₹25 |
| ₹199 | ₹15 (exact slab boundary) |
| ₹270 | ₹15 |
| ₹1,299 | ₹0 |
The same pattern works for commission slabs, rider incentive bands, discount tiers or grading.
Ravindra Bagale's Tip
Slab table madhe khup students "99–198" asa range text madhe lihitat – Excel la to samjat nahi. Fakt lower limit number madhe liha aani table ascending sort theva. VLOOKUP TRUE unsorted table var chukicha fee deto, error nahi – mhanun XLOOKUP −1 surakshit aahe, karan to sort var avalambun nahi.
Practice task
Create a rider incentive slab: 0–19 deliveries ₹0, 20–29 ₹200, 30–39 ₹400, 40+ ₹700. Calculate the incentive for ten riders with all three methods and check that they agree.