Excel Supreme

Excel track · Exercise 48 of 86 Paid

INDEX and MATCH summary

Read a rate from a sorted band table with INDEX and an approximate MATCH.

Intermediate

Three commission bands

Read-only data · answer in B6

In B6, return the commission rate for the units in B5 from the band table.

AB
1Units fromRate
200.02
31000.04
42000.06
5Units sold150
6Rate

Download this grid (.xlsx) Two tabs: the grid you see, and the answer.

B6

What it does

The band table in A2:B4 is read as ranges. 150 sits above the 100 in A3 and below the 200 in A4, so the band that applies starts on row 3 and pays 0.04. MATCH with 1 returns 2, the position of that starting point, and INDEX reads B3.

A third argument of 1 asks for the last starting point at or below the value, which assumes the column is sorted ascending. The column here runs 0, 100, 200. Set 0 instead and MATCH looks for a row that says exactly 150, finds none, and returns #N/A.

The quiet failure is a band column that has drifted out of order. A figure below the first threshold fails loudly, because MATCH finds nothing and the cell shows #N/A. Re-sort the column and check the first row before trusting any rate.

Syntax

=INDEX(rates, MATCH(units, bands, 1))

Worked example

On Three commission bands, =INDEX(B2:B4,MATCH(B5,A2:A4,1)) returns 0.04.

=INDEX(B2:B4,MATCH(B5,A2:A4,1))

Common errors

Error codes for INDEX and MATCH with bands
ErrorWhat it means and how to fix it
#N/AThe units figure is below the first starting point in A2, so no band applies and there is no rate to read.
Wrong bandThe band column is not sorted ascending, so MATCH settles on a neighbouring row and returns its rate.

At work

Commission and tax bands, where the rate changes at thresholds and the table is written smallest first.