ID EN
#Dynamic array

XMATCH

Excel Functions 🇮🇩 Bahasa Indonesia

Dapatkan posisi item dalam daftar atau tabel

Syntax

EXCEL
=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])

Arguments

Parameter Deskripsi
lookup_value The lookup value.
lookup_array The array or range to search.
match_mode [optional] 0 = exact match (default), -1 = exact match or next smallest, 1 = exact match or next larger, 2 = wildcard match, 3 = regex match.
search_mode [optional] 1 = search from first (default), -1 = search from last, 2 = binary search ascending, -2 = binary search descending.

Return Value

Posisi numerik dalam array pencarian

Details

XMATCH adalah pengganti modern untuk fungsi MATCH. Ini adalah fungsi yang fleksibel dan serbaguna dengan sejumlah fitur berguna: Fungsi XMATCH melakukan pencarian dan mengembalikan posisi numerik dari nilai pencarian sebagai hasilnya. XMATCH membutuhkan empat argumen, dan sintaks generiknya terlihat seperti ini: Lookup_value adalah nilai yang dicari, dan lookup_array adalah rentang atau larik yang akan dicari. Argumen match_mode mengontrol jenis pencocokan yang dilakukan (tepat, terkecil berikutnya, terbesar berikutnya, atau wildcard). Search_mode mengontrol arah pencarian (pertama ke terakhir atau terakhir ke pertama) dan mengaktifkan opsi pencarian biner, yang dioptimalkan untuk kecepatan. Lihat di bawah untuk lebih jelasnya. Untuk melakukan pencocokan tepat biasa, hanya diperlukan dua argumen pertama. Misalnya untuk mencari posisi

Contoh

Example 1

The XMATCH function performs a lookup and returns the numeric position of the lookup value as a result. XMATCH takes four arguments, and the generic s

EXCEL
=XMATCH(lookup_value,lookup_array,[match_mode],[search_mode])
Example

To perform an ordinary exact match, only the first two arguments are required. For example, to locate the position of the planet Mars in the worksheet

EXCEL
=XMATCH(G4,B5:B13) // returns 4
Example

The result is 4 since "Mars" appears in the fourth row of the range B5:B13. Typically, the XMATCH function is used together with the INDEX function to

EXCEL
=INDEX(C5:C13,XMATCH(G4,B5:B13)) // returns 6792
Replacing MATCH with XMATCH

In some cases, XMATCH can be a drop-in replacement for the MATCH function. For example, for exact matches, the syntax is identical:

EXCEL
=MATCH(value,array,0) // exact match
=XMATCH(value,array,0) // exact match
Replacing MATCH with XMATCH

However, for approximate matches, the behavior is different when match_type is set to 1:

EXCEL
=MATCH(value,array,1) // exact match or next smallest
=XMATCH(value,array,1) // exact match or next *largest*
Replacing MATCH with XMATCH

In addition, XMATCH allows -1 for match type, which is not available with MATCH:

EXCEL
=XMATCH(value,array,-1) // exact match or next smallest

See Also

XLOOKUP MATCH VLOOKUP HLOOKUP INDEX LOOKUP FILTER