Excel Match Data: 5 Easy Ways

The MATCH function in Excel is a powerful tool that allows users to search for and locate specific data within a range of cells. It is an essential skill for data analysts, researchers, and anyone working with large datasets. In this article, we will explore five easy ways to utilize the MATCH function effectively, providing you with a comprehensive understanding of this versatile tool.
1. Basic MATCH Function: Finding an Exact Value

The most fundamental use of the MATCH function is to find the position of an exact value within a given range. This is particularly useful when you need to identify the location of a specific item in a list. For instance, let’s say you have a list of products and their respective prices, and you want to find the position of a particular product to retrieve its price.
The syntax for the basic MATCH function is as follows:
=MATCH(lookup_value, lookup_array, [match_type])
Here’s a step-by-step guide to using the basic MATCH function:
- Identify the lookup_value: This is the value you want to find in the range.
- Define the lookup_array: Specify the range of cells where you want to search for the lookup value.
- Set the match_type (optional): This argument controls how Excel matches the lookup value. The default is 1, which means an exact match. For an exact match, simply omit this argument.
- Use the MATCH function in a cell and watch Excel return the position of the lookup value within the lookup array.
For example, if you have a list of products in cells A2:A10 and you want to find the position of “Product X,” your formula would be: =MATCH(“Product X”, A2:A10). If “Product X” is the 5th item in the list, Excel will return the value 5.
Real-World Application
Consider a scenario where you’re managing a large inventory of items and need to quickly identify the stock levels for a specific product. By using the MATCH function, you can locate the product’s position in the inventory list and then use that position to retrieve the corresponding stock level.
2. Approximate Match: Finding the Nearest Value

Sometimes, you might not have an exact value to search for, but you need to find the value that is closest to a given reference. This is where the approximate match feature of the MATCH function comes into play. It allows you to locate the largest value that is less than or equal to the lookup value.
To perform an approximate match, you need to set the match_type argument to -1. The syntax is:
=MATCH(lookup_value, lookup_array, -1)
Let’s say you have a list of grades in cells B2:B10, and you want to find the grade range that a student’s score of 85 falls into. Your formula would be: =MATCH(85, B2:B10, -1). If the grade ranges are [70, 80), [80, 90), and [90, 100], Excel will return the value 2, indicating the second grade range.
Practical Example
Imagine you’re working with a dataset of historical stock prices, and you want to determine the price range that a particular stock price falls into. By using the approximate match feature, you can quickly identify the appropriate price range and perform further analysis.
3. Using MATCH with Other Functions: Power Combinations
The true power of the MATCH function lies in its ability to work seamlessly with other Excel functions. By combining MATCH with other functions, you can create powerful formulas to manipulate and analyze data efficiently.
MATCH with INDEX
The INDEX function returns a value or the reference to a value from within a table or range. When combined with MATCH, you can retrieve specific values from a dataset based on their positions.
The syntax for using MATCH with INDEX is:
=INDEX(array, MATCH(lookup_value, lookup_array, [match_type]))
For example, if you have a list of employee names in cells A2:A10 and their corresponding salaries in cells B2:B10, you can use the MATCH function to find the position of an employee’s name and then use that position with the INDEX function to retrieve their salary. The formula would be: =INDEX(B2:B10, MATCH(“Employee Name”, A2:A10)).
MATCH with VLOOKUP
The VLOOKUP function is a popular tool for finding data in a table by searching for a value in the leftmost column of the table. By using MATCH with VLOOKUP, you can enhance the flexibility and accuracy of your lookups.
The MATCH function can be used to determine the column index number, which is then passed to VLOOKUP. This allows you to perform lookups based on any column in the table, not just the leftmost column.
The syntax is:
=VLOOKUP(lookup_value, table_array, MATCH(column_index_num, table_array, 0), [range_lookup])
Here, column_index_num is the column number in the table_array that contains the data you want to retrieve.
4. Handling Errors and Special Cases
When working with large datasets, it’s common to encounter errors or special cases that require careful handling. The MATCH function has built-in error handling to manage these situations.
Error Handling with MATCH
If the lookup value is not found in the lookup array, the MATCH function will return the #N/A error. This error indicates that the value was not found in the specified range.
To handle this error, you can use the ISNA function in combination with MATCH. The ISNA function checks if a value is the #N/A error and returns TRUE if it is. This allows you to perform additional actions or display custom messages when a value is not found.
For example, you can use the formula =IF(ISNA(MATCH(lookup_value, lookup_array, [match_type])), “Value not found”, “Position found”) to display a custom message when the value is not found.
Handling Multiple Matches
In some cases, you might have multiple instances of the lookup value in the lookup array. By default, the MATCH function will return the position of the first occurrence. If you need to handle multiple matches, you can use the COUNTIF function to count the number of occurrences and then adjust your formula accordingly.
5. Advanced MATCH Function: 2D Arrays and Non-Adjacent Ranges

The MATCH function can also work with 2D arrays and non-adjacent ranges, allowing you to perform more complex searches and lookups.
MATCH with 2D Arrays
When working with 2D arrays, you can specify the range to search in both rows and columns. This is particularly useful when you have a table with multiple columns and you need to find the position of a value across different columns.
For example, if you have a table with employee information, and you want to find the position of an employee’s name across different columns, you can use the MATCH function with a 2D array. The syntax is:
=MATCH(lookup_value, lookup_array, [match_type], [exact_match])
Here, lookup_array can be a 2D range, and match_type can be set to 0 for an exact match or -1 for an approximate match.
MATCH with Non-Adjacent Ranges
MATCH can also work with non-adjacent ranges, which are ranges that are not continuous. This is especially useful when you have data spread across different sheets or workbooks.
To use MATCH with non-adjacent ranges, simply specify the ranges as separate arguments. For example, if you have data in cells A2:A10 and C2:C10, you can use the MATCH function as follows: =MATCH(lookup_value, A2:A10, C2:C10).
Performance and Efficiency
When working with large datasets, it’s essential to consider the performance of your MATCH formulas. Excel is optimized to handle large ranges efficiently, but it’s always a good practice to optimize your formulas for speed and accuracy.
One way to improve performance is to use named ranges instead of cell references. Named ranges make your formulas more readable and can enhance calculation speed.
Scenario | MATCH Formula |
---|---|
Finding a Product | =MATCH("Product X", A2:A10) |
Grade Range Lookup | =MATCH(85, B2:B10, -1) |
Employee Salary | =INDEX(B2:B10, MATCH("Employee Name", A2:A10)) |

How do I handle multiple matches with the MATCH function?
+If you have multiple matches, the MATCH function will return the position of the first occurrence by default. To handle multiple matches, you can use the COUNTIF function to count the occurrences and then adjust your formula. For example, you can use a formula like =COUNTIF(lookup_array, lookup_value) to count the number of matches.
Can I use MATCH with dynamic ranges in Excel?
+Yes, you can use MATCH with dynamic ranges in Excel. Dynamic ranges, created using Excel’s Table feature, automatically adjust their size when new data is added or removed. This ensures that your MATCH formulas always refer to the correct range, even if the data changes.
What happens if I use the MATCH function with an empty lookup array or an empty lookup value?
+If the lookup array is empty, the MATCH function will return the #REF! error. If the lookup value is empty, the MATCH function will return the #N/A error. It’s important to ensure that both the lookup array and lookup value are populated to avoid these errors.