The Match function (the function searches for a specified value in an array or cell range) in Excel

The Match function is a fairly common function, applied a lot in the process of calculating and processing data on Excel spreadsheets. The Match function helps you search for a specified value in an array, a range of cells, and then returns the position of the value in the array or range.

The following article introduces the syntax and usage of the Match function in Excel.

The Match function (the function searches for a specified value in an array or cell range) in Excel Picture 1

Description

The MATCH function searches for a specified value in an array or range of cells, and the result is the relative position (or sequence number) of the value in that array or range.

Syntax

= MATCH (lookup_value, lookup_array, match_type)

Inside:

- lookup_value: the value you want to look for in the array (lookup_array), this value can be a number, text or logical value or a cell reference to a number, text or logical value.

- lookup_array: array, range of cells to be searched.

- match_type: search type, there are 3 types of search are -1, 0, 1.

1 or ignore (Less than): The MATCH function searches for the maximum value that is less than or equal to lookup_value. If this type of search is selected, lookup_array must be sorted in ascending order.

0 (Exact match): The MATCH function searches for the first value by exactly lookup_value and the values ​​in lookup_array can be sorted in any order.

-1 (Greater than): The MATCH function searches for the smallest value that is greater than or equal to lookup_value. Values ​​in lookup_array must be sorted in descending order.

Note

- The MATCH function returns the position of the search value in lookup_array, not the search value itself.

- Do not distinguish between uppercase and lowercase letters when looking for text values.

- If no lookup value is found in lookup_array, MATCH will return an error value.

- If match_type is 0 and the lookup_value search value is text, can the search value contain asterisks * (suitable for any string of characters) and a question mark? (matches any single character). And if you want to find a question mark or asterisk, type the tilde ~ before the character.

For example

For the data sheet:

The Match function (the function searches for a specified value in an array or cell range) in Excel Picture 2

The search type is 1 or omitted, for example, searching for position 64 in the Total column :

= MATCH (64, C6: C9,1)

Because the value 64 is not in the Total column, the function will return the position of the largest value that is less than 64 (63) and the result is as follows:

The Match function (the function searches for a specified value in an array or cell range) in Excel Picture 3

The search type is 0, for example, find the position of 65 in the Total column :

= MATCH (65, C6: C9,0)

The Match function (the function searches for a specified value in an array or cell range) in Excel Picture 4

The search type is -1, for example: = MATCH (65, C6: C9, -1) and the error results because arrays are not sorted in descending order.

The Match function (the function searches for a specified value in an array or cell range) in Excel Picture 5

The way to use the Match function is quite simple, with different processing and calculation requirements, you can combine the Match function with some other functions in Excel to process data more efficiently. Good luck!

4 ★ | 1 Vote

May be interested

  • The MODE function (returns the value with the most frequent occurrence in an array or data range) in ExcelPhoto of The MODE function (returns the value with the most frequent occurrence in an array or data range) in Excel
    mode returns the most frequently occurring, repeated value in a given data array. mode is not as common as other functions, but sometimes you still have to use mode to get statistics when needed.
  • Hide value 0 in ExcelPhoto of Hide value 0 in Excel
    in the process of working with excel spreadsheets, for some reason, sometimes you want to hide all zero values. to do this, you only need to perform very simple steps, but if you do not pay attention you may not know how to do it.
  • Use Sparklines in ExcelPhoto of Use Sparklines in Excel
    spark lines in excel is a small chart that you can put inside cells to view data and charts on the same table. you may know a lot about how to use charts in excel but maybe you do not know sparklines.
  • The MIN and MAX functions (the smallest and largest value functions) in ExcelPhoto of The MIN and MAX functions (the smallest and largest value functions) in Excel
    the function to return the maximum value (max) and the function to return the minimum value (min) are two common statistical functions used by a lot of people in the process of manipulating and processing data in excel.
  • Hide / show the Formula Bar in ExcelPhoto of Hide / show the Formula Bar in Excel
    hide / show the formula bar in excel - many times, when calculating, processing data, you accidentally hide the formula bar in excel without knowing it, until you need to use it, you do not know what to do. how to display that formula bar again?
  • How to write fractional values ​​in ExcelPhoto of How to write fractional values ​​in Excel
    sometimes you enter fractions into excel data cells but it shows the time format. you do not know how to handle the input data is displayed as a fraction.