Excel - MATCH function
If you have a range of values, MATCH function finds the position in the range of a value given by you. For example, if you are studying a population and have age groups like below, which age group does age 16 belongs to?
=MATCH(16, A2:A10, 1)
The third argument 1 is the default value, and is optional. It is equivalent to the following formula in this example.
=MATCH(16, A2:A10)
There are 9 numbers from 0 to 80. The returned value is 3, which means the 3rd number in the list. It means age 16 belongs to the 13 to 17 age group. The row number of 13 is 4, but 13 is the 3rd number in the list, so the returned value is 3, not 4.
Tip: The MATCH position only returns the relative position in a list of values, not the age group name such as "13 to 17". To return the age group name, use LOOKUP function instead.
To do exact matching:
The values can be in any order. But the third argument has to be 0, like below:
=MATCH(16, A2:A10, 0)
If the data is ordered from large to small, the third argument of MATCH function should be -1, like below:
=MATCH(16, A2:A10, -1)
This kind of matching is counter-intuitive and we recommend you not using it.
=MATCH(16, A2:A10, 1)
The third argument 1 is the default value, and is optional. It is equivalent to the following formula in this example.
=MATCH(16, A2:A10)
There are 9 numbers from 0 to 80. The returned value is 3, which means the 3rd number in the list. It means age 16 belongs to the 13 to 17 age group. The row number of 13 is 4, but 13 is the 3rd number in the list, so the returned value is 3, not 4.
Tip: The MATCH position only returns the relative position in a list of values, not the age group name such as "13 to 17". To return the age group name, use LOOKUP function instead.
To do exact matching:
The values can be in any order. But the third argument has to be 0, like below:
=MATCH(16, A2:A10, 0)
If the data is ordered from large to small, the third argument of MATCH function should be -1, like below:
=MATCH(16, A2:A10, -1)
This kind of matching is counter-intuitive and we recommend you not using it.
Comments
Post a Comment