INDEX and MATCH With Multiple Criteria In Excel
Last Updated :
31 Jan, 2023
Excel is a wonderful tool and helps you to perform difficult tasks easily by using the defined functions. One such function in MS Excel is INDEX and MATCH. INDEX and MATCH are two functions, but they are used combinedly to find a value using multiple criteria. In other words, you can look up and return values even if there are no unique values to look for. The INDEX/MATCH formula can help you find data points quickly without involving any manual search for them and risk making mistakes. Here, we will understand the syntax and formula in full detail so that you can easily adjust the formula for your particular needs and find values using multiple criteria. There are two ways to use INDEX and MATCH with multiple criteria to find results.
INDEX and MATCH with Multiple Criteria using an Array
Consider the example (as shown below). Which contains information about the Employee's Name, Designation, Team, and Date of Joining.
And we need to find the Date of the Joining of Anuj Goyal who is a Marketing Associate in the company. Collect the prerequisites in the different cells (As shown below).
To find a value with multiple criteria in separate columns, use the generic formula below:
{=INDEX(return_range, MATCH(1, (criteria1=range1) * (criteria2=range2) * (…), 0))}
Where:
- Return_range is the range from which to return a value.
- Criteria1, criteria2, … are the conditions to be met.
- Range1, range2, … are the ranges on which the corresponding criteria should be tested.
Note: The above formula is an array formula and must be completed by pressing Ctrl + Shift + Enter together. This will enclose your formula in {curly brackets}, as shown, which is a visual sign of an array formula in Excel. If you try typing braces manually, that won't work! In our case the values are:
Return_range (Date of Joining) - D2:D8, Criteria1 (Name) - G2, Criteria2 (Team) - G3, Criteria3 (Designation) - G4, Range1 (Name) - A2:A8, Range2 (Team) - B2:B8, Range3 (Designation) - C2:C8
The complete formula is:
=INDEX(D2:D8, MATCH(1, (G2=A2:A8) * (G3=B2:B8) * (G4=C2:C8), 0))
Output:
After pressing Ctrl + Shift + Enter, you'll get the following output
INDEX and MATCH with Multiple Criteria Without using an Array
Considering the same example as used above. We need to find the Date of the Joining of Anuj Goyal who is a Marketing Associate in the company.
To find a value with multiple criteria without using arrays in separate columns, use the generic formula as below:
INDEX(return_range, MATCH(1, INDEX((criteria1=range1) * (criteria2=range2) * (..), 0, 1), 0))
According to our example the formula changes to:
=INDEX(D2:D8, MATCH(1, INDEX((G2=A2:A8) * (G3=B2:B8) * (G4=C2:C8), 0, 1), 0))
Explanation: Return_range (Date of Joining) - D2:D8, Criteria1 (Name) - G2, Criteria2 (Team) - G3, Criteria3 (Designation) - G4, Range1 (Name) - A2:A8, Range2 (Team) - B2:B8, Range3 (Designation) - C2:C8. The INDEX function can handle arrays natively, the second INDEX is just used to "catch" the array formed by the boolean logic operation and return it to MATCH. INDEX is set up with zero rows and one column to do this. The zero-row technique causes INDEX to return column 1 from the array.
Output: After pressing Ctrl + Shift + Enter, you'll get the following output
Similar Reads
Average Cells Based On Multiple Criteria in Excel
An Average is a number expressing the central or typical value in a set of data, in particular the mode, median, or (most commonly) the mean, which is calculated by dividing the sum of the values in the set by their number. The basic formula for the average of n numbers x1,x2,â¦â¦xn is A = (x1 + x2 ..
10 min read
How to use INDEX and MATCH Function in Excel: A Complete Tutorial
Looking for a more flexible and powerful alternative to Excelâs VLOOKUP? The INDEX and MATCH functions are the perfect duo for advanced data lookup and retrieval. This article provides a complete tutorial on how to use INDEX and MATCH in Excel, covering their individual roles and how they work toget
14 min read
Excel COUNTIF Function for Exact and Partial Match (With Examples)
The COUNTIF function in Excel is a powerful tool used to count cells that meet specific criteria, whether it's an exact match or a partial match. This function is incredibly useful for managing large datasets, analyzing trends, or summarizing data quickly. For example, you can use COUNTIF to count h
8 min read
How To Use MATCH Function in Excel (With Examples)
Finding the right data in large spreadsheets can often feel like searching for a needle in a haystack. This is where the MATCH function in Excel proves invaluable. The MATCH function helps you locate the position of a specific value within a row or column, making it a cornerstone of efficient data m
6 min read
XLOOKUP vs INDEX-MATCH in Excel
XLOOKUP can figure out the following more modest or the following bigger worth when there is no definite match. INDEX-MATCH can likewise do such, yet the lookup_array should be arranged in climbing or dropping requests. Both help match Wildcards. XLOOKUP can figure out either the first or the last w
3 min read
Multiple Indexes vs Multi-Column Indexes
A database index is a data structure, typically organized as a B-tree, that is used to quickly locate and access data in a database table. Indexes are used to speed up the query process by allowing the database to quickly locate records without having to search through every row of the table.An inde
4 min read
How to Return Multiple Matching Rows and Columns Using VLOOKUP in Excel?
VLOOKUP function is a premade (already made by Ms-Excel) function in Excel by which we can search for any information in a given spreadsheet. We can use the VLOOKUP function in two ways, first is VLOOKUP with an exact match and VLOOKUP with an approximate match. VLOOKUP with exact match means that k
4 min read
What-If Analysis with Data Tables in Excel
What-if analysis is the option available in Data. In what-if analysis, by changing the input value in some cells you can see the effect on output. It tells about the relationship between input values and output values. In this article, we will learn how to use the what-if analysis with data tables e
5 min read
Combine Multiple Excel Worksheets into Single Dataframe in R
In this article, we will discuss how to combine multiple excel worksheets into a single dataframe in R Programming Language. The below XLSX file "gfg.xlsx" has been used for all the different approaches. Method 1: Using readxl package The inbuilt setwd() method is used to set the working directory
4 min read
How to Sum Values Based on Criteria in Another Column in Excel?
In Excel, we can approach the problem in two ways. [SUMIF Formula and Excel Pivot] Sample data: Sales Report Template We are creating a summary table for Total Product sales. Approach 1: Excel Formula SUMIF Step 1: Copy âColumn Aâ Products and then paste into âColumn Fâ Step 2: Remove duplicate prod
1 min read