To join data in Excel, use the VLOOKUP function (or XLOOKUP in newer versions) to pull matching values from one table into another based on a common column. For example, if you have a list of orders in one sheet and a product price list in another, VLOOKUP can add the price for each order automatically. This guide walks you through joining data using formulas, the Merge & Center feature for text, and Power Query for combining multiple tables. No add-ins are required—just Excel and your data.
What You'll Need
- Microsoft Excel (any recent version; XLOOKUP requires Excel 365 or Excel 2021).
- Two or more data ranges (tables) that share at least one common column, such as an ID, email, or product code.
- Basic familiarity with Excel formulas and cell references.
Step-by-Step
- Prepare your data. Ensure both tables have a common column with matching values. Clean the data: remove extra spaces (use TRIM), ensure consistent formatting (e.g., text vs. number), and convert each range to an Excel Table (select the range, press Ctrl+T). This makes formulas easier to manage and expands automatically.
- Choose your join method. For simple lookups, use VLOOKUP or XLOOKUP. For combining text from multiple cells, use the & operator or TEXTJOIN. For merging entire tables, use Power Query (Data > Get & Transform Data).
- Using VLOOKUP: In the destination table, click the first empty cell where you want the joined value. Type
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). For example,=VLOOKUP(A2, Products!$A$2:$B$100, 2, FALSE)looks up the value in A2 in the Products sheet and returns the corresponding value from the second column. Set the last argument to FALSE for an exact match. Drag the formula down. - Using XLOOKUP (if available): Type
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]). For example,=XLOOKUP(A2, Products!$A$2:$A$100, Products!$B$2:$B$100, "Not found"). This is more flexible than VLOOKUP because it can look to the left and doesn't require counting columns. - Using TEXTJOIN to combine text: If you want to join first and last names, for example, use
=TEXTJOIN(" ", TRUE, A2, B2). The first argument is the delimiter (space), the second ignores empty cells, and the rest are the cells to join. Alternatively, use=A2 & " " & B2. - Using Power Query for table joins: Go to Data > Get & Transform Data > From Table/Range (select your first table). In the Power Query Editor, go to Home > Merge Queries. Select your second table from the dropdown, click the matching column in each table, choose the join kind (e.g., Left Outer for all rows from the first table), and click OK. Expand the new column to include the fields you want. Then click Close & Load to return the joined data to Excel.
- Verify results. Check for #N/A errors (meaning no match found) and ensure the joined data aligns correctly. Use filters or conditional formatting to spot discrepancies.
Common Mistakes
- Mismatched data types: Numbers stored as text won't match numbers. Use VALUE or TEXT to convert, or check with ISTEXT.
- Trailing spaces: Extra spaces cause lookup failures. Use TRIM on both lookup columns.
- Incorrect range references: Forgetting absolute references ($) when dragging formulas causes incorrect lookups. Lock the table array with F4.
- Using approximate match: Omitting FALSE in VLOOKUP can return wrong results if data isn't sorted. Always use FALSE for exact matches.
- Duplicate keys: If the lookup column has duplicates, VLOOKUP returns the first match only. Ensure unique identifiers or use XLOOKUP with a search mode.
Tips
- Convert ranges to Tables (Ctrl+T) so formulas auto-fill and ranges expand.
- Use XLOOKUP if available—it's more robust and doesn't break when columns are inserted.
- For large datasets, Power Query is faster and more reliable than formulas.
- Name your ranges (Formulas > Define Name) to make formulas readable.
- Always keep a backup before merging data, especially with Power Query.
Troubleshooting
If you see #N/A, check that the lookup value exists in the source table and that both are the same data type. Use =ISNUMBER(MATCH(A2, Products!$A$2:$A$100, 0)) to test. If results are wrong, ensure you used FALSE for exact match and that the column index is correct. For Power Query, if the merge returns unexpected rows, review the join kind—Left Outer keeps all rows from the first table, Inner keeps only matches. If Excel is slow, consider using Power Query instead of thousands of VLOOKUP formulas.
Frequently Asked Questions
Can I join more than two tables at once?
Yes, using Power Query you can merge multiple queries sequentially. Each merge adds one table at a time.
What's the difference between VLOOKUP and XLOOKUP?
XLOOKUP is newer and more flexible: it can search left or right, has a built-in not-found option, and defaults to exact match. VLOOKUP only searches to the right of the lookup column.
How do I join text from multiple cells without spaces?
Use the & operator: =A2&B2. For a delimiter, use TEXTJOIN or concatenate with a space: =A2&" "&B2.
Why does my VLOOKUP return the wrong value?
Likely because the range_lookup argument is TRUE (approximate match) and the data isn't sorted. Set it to FALSE for exact match.
Can I join data from different workbooks?
Yes, reference the external workbook in your formula, e.g., =[Book2.xlsx]Sheet1!$A$2:$B$100. Both workbooks must be open for the formula to update.
Is there a limit to how many rows I can join?
Excel supports over 1 million rows, but performance may degrade with complex formulas. Power Query handles large datasets more efficiently.