MATCH

Returns the relative position of an item in an array that matches a specified value in a specified order. Use MATCH instead of one of the LOOKUP functions when you need the position of an item in a range instead of the item itself.

Syntax

MATCH(lookup_value,lookup_array,match_type)

Lookup_value   is the value you use to find the value you want in a table.

Lookup_array   is a contiguous range of cells containing possible lookup values. Lookup_array can be an array or an array reference.

Match_type   is the number -1, 0, or 1. Match_type specifies how Microsoft Excel matches lookup_value with values in lookup_array.

Remarks

Examples

Note that C2:C8 contains text formatted as percent numbers.

In the preceding worksheet:

MATCH(39000,B2:B8,1) equals 3

MATCH(38000,B2:B8,0) equals 2

MATCH(39000,B2:B8,-1) equals the #N/A error value, because the range B2:B8 is ordered incorrectly for match_type -1 matching (the order must be descending to be correct).

Suppose Yen refers to A2:A8, YenDollar to A2:C8, and MyIncome to a cell containing the number ¥6,301,126.33. This formula:


"Your tax rate is "&LOOKUP(MyIncome,YenDollar)&", which places you in tax bracket number "&MATCH(MyIncome,Yen)&"."

produces this result:

"Your tax rate is 22.41%, which places you in tax bracket number 7."