How to Use the MATCH Function in Excel

Let’s explore the MATCH function, a powerful tool in both Microsoft Excel and Google Sheets that allows you to locate the position of a specific item within a range of cells.

Overview

The MATCH function searches for a specified item within a range of cells and returns the item’s relative position. This function is particularly useful for identifying the location of certain values within a row, column, or one-dimensional array.

Syntax

The syntax for the MATCH function is as follows:

MATCH(lookup_value, lookup_array, [match_type])
  • lookup_value: This is the value you want to find within the lookup_array.
  • lookup_array: This refers to the range of cells in which the search will be conducted.
  • match_type (optional): Defines the type of match. This can be 0 for an exact match, 1 for the closest value that is less than or equal to the lookup_value, or -1 for the closest value that is greater than or equal to the lookup_value. If omitted, the default is 1.

Examples

Below, we illustrate how the MATCH function may be applied in various scenarios:

Finding the Position of a Value in a Range

Consider you have a list of student names from cells A2 to A6 and need to determine the position of “Charlie” within this list. Here’s how you can use the MATCH function:

Student Names
Alice
Bob
Charlie
Diana
Emily
=MATCH("Charlie", A2:A6, 0)

This formula will return 3, indicating that Charlie is the third item in the specified range (A2:A6).

Finding the Closest Match

If you’re dealing with a sorted list of numbers and wish to find the closest value below a certain number, the MATCH function can be tailored to meet this need by setting the match_type to -1. For instance:

Numbers
10
20
30
40
50
=MATCH(25, B2:B6, -1)

This formula will return 2, as it matches the position of the value 20, which is the closest number less than 25.

Error Handling

If the MATCH function does not find a match, it will return a #N/A error. You can manage this using the IFERROR function.

=IFERROR(MATCH("David", A2:A6, 0), "Not Found")

This formula outputs “Not Found” if “David” does not appear within the range A2:A6.

By mastering the MATCH function in Excel and Google Sheets, you enhance your capability to efficiently locate and manipulate data positions within your spreadsheet, facilitating streamlined data analysis and management.

More information: https://support.microsoft.com/en-us/office/match-function-e8dffd45-c762-47d6-bf89-533f4a37673a

Other functions
Returns a reference as text to a single cell in a worksheet
Gibt einen Bezug auf eine einzelne Zelle in einem Tabellenblatt als Text zurück
Returns the number of areas in a reference
Gibt einen Bezug zurück, der einen Abstand zu einem angegebenen Bezug hat
Gibt die Anzahl der innerhalb eines Bezugs aufgeführten Bereiche zurück
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
Vrátí funkci ze zadaného odkazu, zformátovanou jako text
Filtruje oblast dat na základě zadaných kritérií
Seřazení obsahu oblasti nebo matice
Seřazení obsahu oblasti nebo matice na základě hodnot v odpovídající oblasti nebo matici
Vrátí seznam jedinečných hodnot v seznamu nebo oblasti
Prohledá oblast nebo matici a vrátí položku odpovídající první nalezené shodě Pokud shoda neexistuje, pak XLOOKUP může vrátit nejpodobnější (přibližnou) shodu
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
Vytvoří zástupce nebo odkaz, který otevře dokument uložený na síťovém serveru, v síti intranet nebo Internet
Uses an index to choose a value from a reference or array
Pomocí rejstříku zvolí hodnotu z odkazu nebo matice
Returns a reference indicated by a text value
Looks up values in a vector or array
Vrátí odkaz určený textovou hodnotou
Vrátí textový odkaz na jednu buňku listu
Returns a reference offset from a given reference
Vrátí počet oblastí v odkazu
Vrátí posun odkazu od zadaného odkazu
Vyhledá hodnoty v odkazu nebo matici
Vrátí číslo řádku odkazu
Vrátí počet řádků v odkazu
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
Načte data v reálném čase z aplikace, která podporuje automatizaci COM
Vrátí počet sloupců v odkazu
Vrátí číslo sloupce odkazu
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
Hledá v prvním sloupci matice a dále ve směru řádku, až vrátí hodnotu buňky
Returns the transpose of an array
Vrátí transponovanou matici
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
Prohledá horní řádek matice a vrátí hodnotu určené buňky
Vyhledá hodnoty ve vektoru nebo matici
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
Returns the relative position of an item in an array or range of cells
Vrátí relativní pozici položky v matici nebo oblasti buněk
Vrátí data uložená v sestavě kontingenční tabulky
Zvolí hodnotu ze seznamu hodnot