Dapatkan posisi item dalam array
=MATCH(lookup_value, lookup_array, [match_type])
| Parameter | Deskripsi |
|---|---|
lookup_value |
The value to match in lookup_array. |
lookup_array |
A range of cells or an array reference. |
match_type |
[optional] 1 = exact or next smallest (default), 0 = exact match, -1 = exact or next largest. |
The MATCH function is used to determine the position of a value in a range or array. For example, in the screenshot above, the formula in cell E6 is c
=MATCH(D6,B6:B14,0) // returns 5
When match_type is zero (0), MATCH performs an exact match only. In the example below, the formula in E3 is:
=MATCH(E2,B3:B11,0) // returns 4
In the formula above, the lookup value comes from cell E2. If the lookup value is hardcoded into the formula, it must be enclosed in double quotes (""
=MATCH("Mars",B3:B11,0)
When match_type is set to 1, MATCH will perform an approximate match on values sorted A-Z, finding the largest value less than or equal to the lookup
=MATCH(E2,B3:B11,1) // returns 5
When match_type is set to zero (0), MATCH can use wildcards. In the example shown below, the formula in E3 is:
=MATCH(E2,B3:B11,0) // returns 6
This is equivalent to:
=MATCH("pq*",B3:B11,0)