Lookup in Multiple Columns Excel: Best Methods Explained
In this article
To look up a value across multiple columns in Excel, the most efficient modern method is using the XLOOKUP function with a concatenated array or the INDEX and MATCH functions combined. While a standard VLOOKUP only searches the leftmost column of a range, searching multiple columns allows you to find a value regardless of which column it resides in, or to find a record based on multiple criteria (e.g., finding a price based on both "Product Name" and "Size").
What You'll Need
- Microsoft Excel (Office 365 or Excel 2021 for XLOOKUP; any version for INDEX MATCH).
- A dataset with a clear structure where the lookup values and the return values are organized in rows and columns.
- A basic understanding of cell referencing (e.g., A2, B10:C20).
Step-by-Step
Depending on your version of Excel and your specific goal, there are three primary ways to achieve a multi-column lookup. We will cover the modern XLOOKUP method, the classic INDEX MATCH method, and the Helper Column method.
Method 1: XLOOKUP for Multiple Criteria (The Modern Way)
Use this method when you need to find a value based on two or more different columns (e.g., searching for a specific Employee Name in Column A AND a specific Department in Column B).
- Select the cell where you want the result to appear.
- Type
=XLOOKUP(to begin the formula. - Create a combined lookup value by using the ampersand (&). For example, if your first criteria is in cell F2 and your second is in G2, type
F2&G2. - Enter a comma to move to the
lookup_arrayargument. - Select the columns you are searching in, also joined by the ampersand. For example, if names are in Column A and departments are in Column B, type
A2:A100&B2:B100. - Enter a comma and then select the
return_array(the column containing the data you actually want to retrieve, such as Column C for Salary). - Close the parentheses and press Enter. The final formula looks like:
=XLOOKUP(F2&G2, A2:A100&B2:B100, C2:C100).
Method 2: INDEX and MATCH for Flexible Lookups
Use this method if you are on an older version of Excel or need to perform a lookup where the return column is to the left of the lookup column.
- Select your target cell.
- Start with the INDEX function:
=INDEX(. - Select the range of cells that contains the answer you want to retrieve (the return column). Enter a comma.
- Now, nest the MATCH function to find the row number:
MATCH(. - Enter the lookup value you are searching for. Enter a comma.
- Select the column where that value is located.
- Set the match type to 0 for an exact match:
,0). - Close the final parenthesis for the INDEX function. The result looks like:
=INDEX(C2:C100, MATCH(F2, A2:A100, 0)). - To make this work across multiple columns for a single value, you can wrap this in an IFERROR function to chain multiple MATCH attempts:
=IFERROR(INDEX(C2:C100, MATCH(F2, A2:A100, 0)), IFERROR(INDEX(C2:C100, MATCH(F2, B2:B100, 0)), "Not Found")).
Method 3: The Helper Column (The Simplest Logic)
If complex formulas feel overwhelming, a helper column physically combines your data into one searchable string.
- Insert a new blank column to the left of your data.
- In the first cell of this new column (e.g., A2), use the concatenation formula:
=B2&C2(assuming B and C are the columns you want to search). - Drag the fill handle down to apply this to all rows. This creates a unique identifier for every row.
- Now, use a standard VLOOKUP or XLOOKUP. Your lookup value will also need to be concatenated.
- Example:
=VLOOKUP(F2&G2, A2:D100, 4, FALSE). This tells Excel to look for the combined string in your new helper column and return the value from the 4th column.
Common Mistakes
- Mismatched Range Sizes: In XLOOKUP or INDEX MATCH, the lookup array and the return array must be the exact same height. If you select A2:A100 for the lookup but C2:C50 for the return, Excel will return a #VALUE! error.
- Data Type Mismatches: Searching for a number stored as text (or vice versa) is a frequent cause of failure. If your lookup value is a number but the column contains text, the formula will return #N/A even if they look identical.
- Forgetting the Exact Match: In VLOOKUP and MATCH, omitting the 0 or FALSE argument tells Excel to look for an approximate match. This often leads to the formula returning the wrong row if the data isn't sorted alphabetically.
- Hidden Spaces: Leading or trailing spaces in your cells (e.g., "Apple " instead of "Apple") will cause a lookup to fail.
Tips
- Use Named Ranges: Instead of using A2:A100, highlight the range and name it "EmployeeList" in the Name Box (top left). Your formula becomes
=XLOOKUP(F2, EmployeeList, SalaryList), which is much easier to read and maintain. - The TRIM Function: To avoid errors caused by accidental spaces, wrap your lookup array in the TRIM function:
=XLOOKUP(F2, TRIM(A2:A100), C2:C100). Note that this may require pressing Ctrl+Shift+Enter in very old versions of Excel. - Absolute References: When dragging a lookup formula down a column, always use dollar signs (e.g., $A$2:$A$100) to lock the range. Otherwise, the search area will shift downward as you copy the formula, missing the top rows of your data.
- Table Formatting: Convert your data range into an official Excel Table (Ctrl+T). Tables use structured references (e.g., [Salary]) that automatically expand when you add new rows, meaning you never have to update your formula ranges.
Troubleshooting
If your formula is not returning the expected result, follow these steps in order:
- Check for #N/A: This usually means the value simply isn't there. Double-check for typos or hidden spaces using the
=LEN()function to see if a cell has more characters than it appears to. - Verify Range Alignment: Ensure all arrays in your formula start and end on the same row numbers. If one starts at row 1 and another at row 2, your results will be shifted by one row.
- Test Components Separately: If using a complex INDEX MATCH, highlight the MATCH part of the formula in the formula bar and press F9. This will show you the row number Excel is finding. If it shows #N/A, the problem is with your lookup value or search column, not the return column.
- Check Calculation Settings: Go to the Formulas tab > Calculation Options and ensure "Automatic" is selected. If it is set to "Manual," your lookup won't update when you change the search criteria.
- Convert Data Types: If you suspect a text-vs-number issue, select the column, go to the Data tab > Text to Columns > Finish. This often forces Excel to re-evaluate the data type and fix formatting errors.
Frequently Asked Questions
Can I look up a value across multiple columns if I don't know which column it is in?
Yes. You can use a nested IFERROR approach with XLOOKUP or VLOOKUP, where Excel tries the first column, and if it fails, moves to the second. Alternatively, you can use a combination of SUMPRODUCT or TOCOL (in newer versions) to flatten the data into one searchable list.
Does XLOOKUP work in all versions of Excel?
No. XLOOKUP is available in Microsoft 365 and Excel 2021 or later. If you are using Excel 2019, 2016, or older, you must use the INDEX and MATCH combination or VLOOKUP.
What is the difference between a multi-criteria lookup and a multi-column search?
A multi-criteria lookup uses multiple columns to identify a single unique row (e.g., First Name + Last Name). A multi-column search looks for one value that could be in any of several different columns.
How do I handle multiple results for the same lookup value?
Standard lookup functions only return the first match they find. To retrieve all matches, use the FILTER function: =FILTER(ReturnRange, LookupRange=Criteria). This will return a dynamic array of all matching rows.
Can I use a wildcard in a multi-column lookup?
Yes, XLOOKUP and MATCH both support wildcards. In XLOOKUP, you must set the [match_mode] argument to 2. For example, searching for "*North*" will find any cell containing the word "North" regardless of what comes before or after it.