Yes, you can match information from two Excel sheets instantly by using the VLOOKUP or XLOOKUP function, or by using the Power Query Get & Transform tool for a non-destructive method. These tools allow you to pull data from one sheet into another based on a common identifier, such as an ID number, name, or email address. Before you begin, ensure both sheets are open in the same workbook or that you know the file paths, as this determines which method you should use.
What You'll Need
- A computer with Microsoft Excel installed (the methods below apply to Excel 2016 and later, including Excel for Microsoft 365).
- Two Excel workbooks or two sheets within the same workbook containing the data you wish to join.
- A column of data present in both sheets that you can use as a reference point (e.g., "Customer ID", "Product SKU", or "Email Address").
- A basic understanding of how to copy and paste cell references, as formulas will be used.
Step-by-Step
When matching data, the process depends on whether you are using the newer Excel versions (which support XLOOKUP) or older versions, and whether you want to keep the original data untouched or permanently merge it. The following steps cover the most efficient and accurate methods for modern Excel users.
Method 1: Using XLOOKUP (Best for Excel 365 and Excel 2021)
XLOOKUP is the most robust function for this task. It is superior to VLOOKUP because it can search in any direction and does not require the lookup column to be the first column in the table. It also returns a "#N/A" error if no match is found, rather than a zero or an error code that can be confusing.
- Open your Excel workbooks. If the sheets are in different workbooks, open both files. If they are in different sheets, switch between them using the tabs at the bottom of the window.
- Identify your unique identifier. Look for a column that exists in both sheets and contains unique values for each row (e.g., a unique Order ID). This is the key you will use to match the rows.
- Click the cell where you want the matched data to appear. This is usually in a new column adjacent to your data in the sheet where you want to display the results.
- Type the equals sign (=) followed by the function name. Type
=XLOOKUP(to begin the function. Excel will usually provide a tooltip to help you. - Select the lookup value. Click on the cell in your current sheet that contains the unique identifier (e.g., the Order ID) you are trying to match. Do not type the number directly; let Excel reference the cell. Add a comma to separate arguments.
- Select the lookup array. Switch to the second sheet (or select the range in the other sheet), click on the column header containing the unique identifiers, and drag to select the entire column. Add a comma.
- Select the return array. Switch back to the second sheet (or select the range), and click on the column header containing the data you want to retrieve (e.g., the "Customer Name" or "Total Amount"). Drag to select the entire column. Add a comma.
- Specify the search mode (optional). You can leave this argument blank for a standard left-to-right search. If you know there are duplicates and you want the first match, you can leave it blank. If you want the last match, type
2. For most standard tasks, you can leave this blank. - Close the parenthesis and press Enter. Type
)and hit Enter. Excel will calculate the result for the first row. To fill the rest of the column, click the bottom-right corner of the cell and drag it down.
Method 2: Using the FILTER Function (For Lists of Matches)
If you have multiple matches for a single lookup value (e.g., one customer has multiple orders) and you want to list all of them, the FILTER function is ideal.
- Click the cell where you want the list of results to start. This is typically in a blank area of your sheet.
- Type the equals sign (=) followed by the function name. Type
=FILTER(. - Select the return array. This is the list of data you want to display. Click on the column in the second sheet containing the values you want to see. Add a comma.
- Select the include array (the criteria). This is the range of the unique identifiers in the second sheet. Add a comma.
- Select the lookup value. Click on the cell in your current sheet that contains the specific identifier you are filtering for. Add a comma.
- Close the parenthesis and press Enter. Type
)and hit Enter. If there is no match, Excel will return an error.
Method 3: Power Query (Get & Transform) for a Permanent Merge
If you are working with large datasets, want to avoid formulas, or need to update the data regularly, Power Query is the best approach. This method creates a connection to your data sources and merges them into a new table.