How to Use the XMATCH Function in Excel

The XMATCH function is a sophisticated tool designed for locating and retrieving data from a range or an array in both Excel and Google Sheets. This function serves as a contemporary substitute for the traditional MATCH function, offering additional features and greater flexibility. In this article, we will delve into the syntax, examples, and practical uses of XMATCH across both Excel and Google Sheets.

Syntax

The syntax of the XMATCH function is consistent across both Excel and Google Sheets:

XMATCH(lookup_value, lookup_array, [match_mode], [search_mode], [search_result])
  • lookup_value: The value you are searching for within the lookup_array.
  • lookup_array: The range or array where the search will be conducted.
  • match_mode: (Optional) 0 for an exact match, -1 for exact match or the next smaller item, 1 for exact match or the next larger item. The default is 1.
  • search_mode: (Optional) 1 for normal search from first to last, -1 for reverse search from last to first, 2 for binary search which is suitable for sorted data. The default is 1.
  • search_result: (Optional) 0 returns the position of the matching value, 1 returns the actual value from the matching cell. The default is 0.

Finding the Position of a Value

For instance, if you have a column (Column A) listing student names and need to find the position of a specific name, you can use the XMATCH function as follows:

Name Position
John =XMATCH(“John”, A:A, 0)

Returning the Value

Should you need to retrieve the actual value from the cell, rather than its position, modify the XMATCH function accordingly. For example:

Name Result
John =XMATCH(“John”, A:A, 0, , 1)

Using XMATCH with Multiple Criteria

XMATCH can also be integrated with other functions to handle searches based on multiple criteria. For example, if you have a list of students along with their scores and want to find a particular student’s score, you can combine XMATCH with the INDEX function:

Name Score
John =INDEX(B:B, XMATCH(“John”, A:A, 0))

These examples illustrate just a few ways the XMATCH function can be effectively utilized in Excel and Google Sheets for efficient data search and retrieval. Experiment with various parameters and combinations to maximize its utility in your data analysis and management tasks.

More information: https://support.microsoft.com/en-us/office/xmatch-function-d966da31-7a6b-4a13-a1c6-5a33ed6a0312

Other functions
Returns a reference as text to a single cell in a worksheet
Returns the number of areas in a reference
Chooses a value from a list of values
Returns the column number of a reference
Returns the number of columns in a reference
Filters a range of data based on criteria you define
Returns the formula at the given reference as text
Returns data stored in a PivotTable report
Looks in the top row of an array and returns the value of the indicated cell
Creates a shortcut or jump that opens a document stored on a network server, an intranet, or the Internet
Uses an index to choose a value from a reference or array
Returns a reference indicated by a text value
Looks up values in a vector or array
Looks up values in a reference or array
Returns a reference offset from a given reference
Returns the row number of a reference
Returns the number of rows in a reference
Retrieves real-time data from a program that supports COM automation
Sorts the contents of a range or array
Sorts the contents of a range or array based on the values in a corresponding range or array
Returns the transpose of an array
Returns a list of unique values in a list or range
Looks in the first column of an array and moves across the row to return the value of a cell
Searches a range or an array, and returns an item corresponding to the first match it finds If a match doesn't exist, then XLOOKUP can return the closest (approximate) match