You can use the following methods to return the column number of a match in Excel:
Method 1: Return Column Number of Match within Table
=MATCH(H2, C1:F1, 0)
This particular formula will look up the value in cell H2 in the range C1:F1 and then return the column number that matches the value in cell H2.
Method 2: Return Column Number of Match within Entire Spreadsheet
=MATCH(H2, $1:$1, 0)
This particular formula will look up the value in cell H2 in the entire first row of the spreadsheet and then return the column number that matches the value in cell H2.
The following examples show how to use each method in practice with the following dataset in Excel:
Note: The value of 0 in the last argument of the MATCH function tells Excel to look for an exact match.
Example 1: Return Column Number of Match within Table
We can type the following formula into cell I2 to find the column number in the range C1:F1 that matches the value in cell H2:
=MATCH(H2, C1:F1, 0)
The following screenshot shows how to use this formula in practice:
The formula returns a value of 3 since the name “Assists” is located in column 3 of the range that we specified.
Example 2: Return Column Number of Match within Entire Spreadsheet
We can type the following formula into cell I2 to find the column number in the entire spreadsheet that matches the value in cell H2:
=MATCH(H2, $1:$1, 0)
The following screenshot shows how to use this formula in practice:
The formula returns a value of 5 since the name “Assists” is located in column 5 of the entire spreadsheet.
Note that the range $1:$1 in the formula indicates that we should look for the value “Assists” in row 1 of the entire spreadsheet.
We could also drag this formula down to more cells in column I to find the column number of other names:
We can see that “Rebounds” is located in column 6 of the entire spreadsheet.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel:
Excel: Count Number of Matches Between Two Columns
Excel: How to Find All Values that Match Criteria
Excel: How to Find Matching Values in Two Worksheets