How To Merge Data In Excel: The Definitive Step-by-Step Guide

How To Merge Data In Excel: The Definitive Step-by-Step Guide

How to merge cells in Excel? - Scaler Topics

Merging data in Excel involves combining text strings, consolidating duplicate rows, or joining separate tables using relational keys like VLOOKUP, XLOOKUP, or Power Query. Mastering these exact methods eliminates redundant data entry errors and transforms fragmented spreadsheets into streamlined reporting powerhouses.


Pre-Operation Setup and Planning Requirements

Proper data hygiene and structural planning dictate the success of any data consolidation project in Microsoft Excel. Before writing a single formula or launching an import wizard, analysts must verify source data integrity, define the matching criteria, and establish a repeatable workflow to prevent data corruption.



  • Essential Tools and Software: Microsoft Excel (Microsoft 365 or Excel 2019/2021 recommended for modern dynamic array functions and Power Query capabilities).
  • Mandatory Prerequisite Knowledge: Basic understanding of tabular layouts, header rows, unique identifiers (primary keys), and relative versus absolute cell referencing.
  • Estimated Duration and Scope: 15 to 30 minutes for standard lookups and concatenation; 45 to 60 minutes for advanced Power Query relational merges across multiple workbooks.

Step-by-Step Workflow for Consolidating and Combining Spreadsheets



Step 1: Standardizing and Formatting Source Data

Before attempting any merge operation, ensure that all source tables share consistent data types, identical header titles, and zero trailing spaces. Raw data containing formatting inconsistencies will immediately break formula-based merges and Power Query relations.

  1. Highlight your dataset and press Control plus T to convert standard ranges into official Excel Tables, which automatically expand when new rows are added.
  2. Remove invisible trailing spaces across text columns by applying the TRIM function in a temporary helper column.
  3. Verify that lookup keys, such as Employee IDs or SKU numbers, share the exact same data type across all sheets; a number stored as text will not match a standard numeric integer.

Pro-Tip: Always preserve a raw, untouched backup copy of your source spreadsheets in a separate workbook before executing bulk data transformations or destructive merges.



Step 2: Joining Two Tables Using XLOOKUP

When you need to pull matching columns from a secondary table into your primary master sheet based on a shared unique identifier, the XLOOKUP function provides the most robust and flexible solution.

  1. Navigate to your destination master sheet and select the first blank cell where the merged data should appear.
  2. Type the equals sign followed by XLOOKUP, then select the unique lookup value cell in your primary row.
  3. Highlight the lookup array column in your secondary source table, followed by the return array column containing the data you wish to pull.
  4. Press Enter to execute the formula, and then double-click the fill handle in the bottom-right corner of the cell to propagate the formula down the entire column.

Warning: Avoid legacy VLOOKUP formulas when merging large datasets, as they break if columns are inserted into the source table and default to approximate matching if the fourth argument is omitted.



Step 3: Combining Text Strings with CONCAT or Text Joining

When your objective is to merge separate text columns—such as splitting first and last names into a single full name cell—use modern text joining functions instead of manual typing.

  1. Select the target cell where the combined text string must reside.
  2. Enter the TEXTJOIN function to automatically insert delimiters and ignore empty cells, specifying a space or comma as your separator argument.
  3. Alternatively, utilize the CONCAT function to manually string together cell references alongside literal text enclosed in quotation marks.
  4. Convert the resulting formula output into static text values by selecting the column, copying it, and pasting it back as values to prevent circular reference or update lag.


Step 4: Automating Complex Merges with Power Query

For recurring monthly consolidations involving dozens of files or millions of rows, Power Query provides an enterprise-grade ETL workflow without requiring VBA macros.

  1. Navigate to the Data ribbon tab, select Get Data, and choose your data source files from a folder or workbook.
  2. In the Power Query Editor interface, clean, filter, and transform your columns before executing the final join.
  3. Click the Merge Queries button on the Home tab, select your matching primary and secondary relationship columns, and choose the appropriate join kind such as Left Outer or Inner.
  4. Expand the newly appended table column to expose the specific fields you want to bring into your final report, then click Close and Load to output the unified dataset directly into an Excel worksheet or Data Model.

How To Merge Two Cells In Excel Sheet - Design Talk

How To Merge Two Cells In Excel Sheet - Design Talk

Comparison of Excel Data Merging Methods



Method Best Used For Primary Advantage Technical Limitation
XLOOKUP Pulling columns from table B into table A based on a shared key Highly intuitive, non-sensitive to column insertions Performance degrades on extremely large workbooks over one million rows
TEXTJOIN Combining first/last names or addresses into one cell Automatically handles delimiters and ignores blank cells Cannot pull data from separate, unlinked tables automatically
Power Query Consolidating multiple workbooks or massive datasets Fully repeatable, handles multi-source relational merges effortlessly Steeper learning curve for users unfamiliar with ETL concepts
Consolidate Tool Summing or averaging data from identical sheet layouts Fast point-and-click interface for numerical summary reports Requires identical row and column labels across all source sheets

Common Merge Errors and Field Fixes



  • The #N/A Error in Lookups:

    • Root Cause: The unique lookup value exists in the primary sheet but cannot be found in the secondary source array due to trailing spaces, hidden formatting mismatches, or typos.
    • Actionable Fix: Wrap your lookup value inside a TRIM function, or use the XLOOKUP error-handling argument to return a blank string instead of an error message.
  • Truncated Numbers After Merge:

    • Root Cause: Excel automatically converts imported text-based IDs (like postal codes or serial numbers) into numeric values, stripping leading zeros.
    • Actionable Fix: Format the destination column as Text before running your merge, or use Power Query to explicitly define data types during the import phase.
  • Power Query Circular Reference Warnings:

    • Root Cause: Pointing a Power Query consolidation folder directly to the same directory where the output report file is saved.
    • Actionable Fix: Move your raw source files into a dedicated incoming directory that is entirely separate from your final reporting dashboard workbook.

Frequently Asked Questions



How do I merge two columns in Excel without losing data?

You can combine two columns using the TEXTJOIN or CONCAT functions in a new helper column, which preserves the original source data. Once combined, copy the new column and use Paste as Values if you need to delete the original source columns safely.



What is the difference between merging and consolidating in Excel?

Merging involves joining two separate tables side-by-side using a shared relational key, while consolidating involves combining data from multiple identical sheets into a single summary report by adding or averaging values.



Can I merge data in Excel without writing formulas?

Yes, you can use the Power Query interface to perform visual database-style merges, or use the Consolidate feature under the Data tab to combine numerical data ranges instantly.



Why is my XLOOKUP formula returning incorrect data values?

This typically occurs when your lookup array is not sorted correctly or when exact matching is disabled. Ensure the third argument in your XLOOKUP function is set to zero for an exact match.

Streamline your analytical workflows today by mastering advanced Excel consolidation techniques and eliminating manual data entry bottlenecks.


Excel Tutorial: How To Merge And Center Cells In Excel - WXSPZZ

Excel Tutorial: How To Merge And Center Cells In Excel - WXSPZZ

Read also: State Correctional Institution Somerset (SCI Somerset) PA 2026: Facilities, Operations, and Visitor Guide