Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel: Consolidate Rows into One Row

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To consolidate multiple rows into one row in Excel, you can use the Merge & Center feature for layout purposes, or combine values from several rows into a single cell using formulas like TEXTJOIN or CONCAT. For a true data consolidation (summing, counting, or averaging values across rows), use Data > Consolidate. The method you choose depends on whether you want to merge cells visually, combine text, or aggregate numbers. Below are step-by-step instructions for each approach.

What You'll Need

  • Microsoft Excel (any recent version; steps may vary slightly by version and platform).
  • Your data organized in rows and columns, with a clear header row.
  • For formula-based consolidation, familiarity with basic functions is helpful but not required.

Step-by-Step

Method 1: Merge Cells to Visually Combine Rows

  1. Select the cells across the rows you want to merge into one row. For example, if you want to combine A1:C1, A2:C2, and A3:C3 into a single row, select A1:C3.
  2. Go to the Home tab on the ribbon.
  3. In the Alignment group, click Merge & Center. Choose Merge Cells if you don't want centering.
  4. Excel will keep only the upper-left value and discard the rest. If you need to preserve all data, use one of the other methods instead.

Note: Merging cells is mainly for presentation and can make sorting, filtering, and data analysis difficult. Use it sparingly.

Method 2: Combine Text from Multiple Rows into One Cell

  1. Decide where you want the consolidated text to appear. For example, if you want to combine values from A1, A2, and A3 into a single cell, pick an empty cell like B1.
  2. Enter a formula using TEXTJOIN (available in Excel 2019 and later, and Microsoft 365). For example: =TEXTJOIN(", ", TRUE, A1:A3). This joins the values with a comma and space, ignoring empty cells.
  3. Press Enter. The combined text will appear in the cell.
  4. If you have an older version without TEXTJOIN, use =A1 & ", " & A2 & ", " & A3 or the CONCATENATE function (now CONCAT).
  5. To apply this to many rows, drag the fill handle down. Adjust cell references accordingly.

Method 3: Consolidate Data by Summing or Counting Across Rows

  1. Ensure your data has a consistent structure: each row should represent a record, and columns should have headers.
  2. Click on a blank cell where you want the consolidated result to start. This will be the upper-left corner of the output range.
  3. Go to the Data tab, then click Consolidate in the Data Tools group.
  4. In the Function dropdown, choose the operation you want (e.g., Sum, Count, Average).
  5. Click the Reference box, then select the range of rows you want to consolidate. If the data is on another sheet, click Browse to locate it.
  6. Click Add to add the reference to the All references list. Repeat for additional ranges if needed.
  7. Check Top row and Left column if your data includes labels.
  8. Click OK. Excel will create a summary that combines the data from the selected rows into a single row per unique label.

Common Mistakes

  • Merging cells instead of combining data: Merge & Center discards all but the top-left value. Use formulas or Consolidate to keep data.
  • Forgetting to adjust cell references: When copying formulas, relative references may shift incorrectly. Use absolute references (e.g., $A$1) if needed.
  • Inconsistent data types: Consolidate may not work correctly if some cells are text and others are numbers. Ensure consistent formatting.
  • Overlooking empty cells: TEXTJOIN with the ignore_empty argument set to TRUE handles blanks, but CONCATENATE will include them as empty strings.
  • Not backing up data: Always work on a copy or save before using Consolidate, as it overwrites the destination cells.

Tips

  • Use TEXTJOIN for flexible text consolidation with a delimiter of your choice.
  • For simple concatenation without delimiters, use CONCAT or the ampersand (&) operator.
  • If you need to consolidate rows based on a common key (e.g., customer ID), consider using a PivotTable instead of the Consolidate feature.
  • To combine rows into one row while keeping all data, you can use Power Query (Get & Transform Data) to group and concatenate rows.
  • When using Consolidate, ensure the destination area is empty to avoid overwriting existing data.

Troubleshooting

  • Consolidate button is greyed out: Make sure you have a range selected and that the workbook is not protected. Also, Consolidate is not available in Excel for the web; use the desktop app.
  • Formula returns #VALUE! error: Check that all referenced cells contain text or numbers, not errors. TEXTJOIN ignores empty cells but not errors.
  • Merged cells cause issues with sorting: Avoid merging cells if you plan to sort or filter. Instead, use Center Across Selection (Format Cells > Alignment) for a similar look without merging.
  • Consolidate doesn't combine rows as expected: Ensure the labels in the left column match exactly across ranges. Use Data > Remove Duplicates to clean up.
  • TEXTJOIN not available: If you have an older Excel version, use CONCATENATE or the & operator, or upgrade to Microsoft 365.

Frequently Asked Questions

Can I consolidate rows without losing data?

Yes, use formulas like TEXTJOIN or CONCAT to combine values into a single cell, or use Data > Consolidate to aggregate numbers. Merging cells will lose data.

How do I combine multiple rows into one row with a comma separator?

Use =TEXTJOIN(", ", TRUE, range) where range is the cells you want to combine. For older Excel, use =A1 & ", " & A2 & ", " & A3.

What is the difference between Merge & Center and Consolidate?

Merge & Center visually combines cells into one, keeping only the top-left value. Consolidate aggregates data from multiple ranges using functions like Sum or Count, without merging cells.

Can I consolidate rows from multiple worksheets?

Yes, the Consolidate feature allows you to add references from different sheets or workbooks. Just click Browse to select the file or sheet.

Why does Consolidate give me a #REF! error?

This often happens if the reference includes the destination cell or if the ranges overlap. Ensure the destination is separate and references are correct.

Is there a way to automatically consolidate rows as I add data?

You can use Power Query to set up a query that groups and concatenates rows; refresh the query when data changes. Formulas can also be set to recalculate automatically.