match() function and countif() function usage

1. match() function

The MATCH () function is one of the main search functions of EXCEL, which refers to returning the position of the specified value in the specified array area. This function is usually used to (1) determine the position of a certain value in a list; (2) determine whether a certain value exists in a certain list; (3) determine whether there is duplicate data in a certain list; (4) locate a certain value in a certain list The position of the last non-empty cell.

When looking up text values, the function MATCH does not distinguish between uppercase and lowercase letters. Returns the position of the specified value in the specified array range

语法:MATCH(lookup_value, lookup_array, match_type)

lookup_value: The value to be looked up in the data table (lookup_array). Can be a numeric value (number, text, or logical value) or a cell reference to a number, text, or logical value.

lookup_array: A contiguous range of cells that may contain all values ​​to be looked up.

match_type: Indicates the specified method of the query, represented by the number -1, 0 or 1, and the omission of match_type is equivalent to the case where match_type is 0.

When it is 1, find the position of the largest value less than or equal to lookup_value in lookup_array, and
lookup_array must be arranged in ascending order: when it is 0, find the first value equal to lookup_value, and
lookup_array is arranged in any order: when it is -1, search for values ​​greater than Or the position of the minimum value equal to lookup_value in lookup_array.

2. countif function

The Countif function is a function in Microsoft Excel that counts the cells that meet the specified conditions in the specified range. The syntax of this function is as follows: countif(range, criteria)

Parameters: range The range in which the number of non-empty cells is to be counted.

Parameters: criteria Criteria defined as numbers, expressions, or text.

The functions that need to be introduced or reviewed are finished, let's look at the formulas we need to give today: enter the formula in E2:

=INDEX($C 2 : 2: 2:C$12,MATCH(0,COUNTIF(E 1 : E 1 , 1:E1, 1:E 1 , C2 : 2:2:C$12),0)) & “”

Formula explanation:

COUNTIF(E 1 : E 1 , 1:E1,1:E 1 , C2 : 2:2: C12 ) in 12) in12 ) In C2:2:2: Find the number of occurrences of E$1:E1 in the C$12 area, and return an array.

MATCH(0,COUNTIF(E 1 : E 1 , 1:E1, 1:E 1 , C2 : 2:2: C$12),0) Find the first position of 0 in the array generated above.

Guess you like

Origin blog.csdn.net/weixin_53952878/article/details/125858583