How to Combine Rows in Google Sheets Without Losing Data

How-to basics · Updated November 3, 2026

How to Combine Rows in Google Sheets Without Losing Data

To combine rows in Google Sheets, first decide whether you want to merge cells visually or join the contents of several rows into one cell. For a visual merge, select the cells and choose Format > Merge cells; to preserve every value, use a formula such as =TEXTJOIN(" ", TRUE, A2:A4) instead. Merging cells keeps only the upper-left value, so make a copy or use a formula when the other contents matter.

What You’ll Need

  • A Google account and a spreadsheet open in Google Sheets in a web browser.
  • The rows or cells you want to combine, and a clear idea of whether you need a visual merge or a combined text result.
  • If the values matter, an empty destination cell for a formula. Consider duplicating the sheet first if you plan to change a large range.

Step-by-Step

  1. Choose the result you need. Use Merge cells when you want one larger cell across adjacent rows or columns, such as a heading centered across several cells. Use a formula when you need to bring together text or values from multiple rows without discarding the originals. These are different operations: a merged cell changes the layout, while a formula creates a new result.
  2. Check the data before making changes. Look at every cell in the range, not just the first row. Google Sheets retains the value in the upper-left cell when you merge a range and removes the other cell contents. If those contents need to be kept, do not merge them directly. Make a copy of the sheet with the sheet tab menu or copy the data to another area before proceeding.
  3. Merge cells vertically for a visual combination. Select the cells in one column that run through the rows you want to combine. For example, select A2:A4 to create one cell covering those three rows. Choose Format > Merge cells > Merge vertically. If the range contains values in more than one cell, read the warning and cancel if you need to retain all of them. Otherwise, confirm the merge. The upper-left cell, A2 in this example, supplies the surviving value.
  4. Choose a different merge direction when the layout calls for it. To combine adjacent cells across a single row, select that row’s cells and choose Format > Merge cells > Merge horizontally. To make one cell from a rectangular selection, choose Format > Merge cells > Merge all. Merge all is usually appropriate for a heading or label, not a normal data table. The menu’s merge options may vary depending on the shape of your selection; choose the option that matches it.
  5. Use TEXTJOIN to combine text and preserve the source rows. Suppose A2:A4 contains North, Service, and Desk, and you want the words in one cell. Put the formula in an empty destination cell, such as B2. With those values in A2:A4, enter =TEXTJOIN(" ", TRUE, A2:A4). The result is North Service Desk. The space between the quotation marks is the separator, and TRUE tells Sheets to skip blank cells. Change the separator to a comma and a space, such as =TEXTJOIN(", ", TRUE, A2:A4), if you want a comma-separated list.
  6. Combine several columns from the same row if that is your goal. For example, if A2 contains a first name, B2 a last name, and C2 a department, put a formula in D2. With those values in A2:C2, enter =TEXTJOIN(" | ", TRUE, A2:C2). The result will join the nonblank values with a vertical bar separator, such as Jordan Lee | Support. This creates a combined result for that record; it does not merge the worksheet rows themselves.
  7. Use line breaks when each source value should appear on its own line. With the values North, Service, and Desk in A2:A4, enter =TEXTJOIN(CHAR(10), TRUE, A2:A4) in an empty cell. The result contains a line break between each value. Select the result cell and choose Format > Wrapping > Wrap so the lines can display inside the cell. Increase the row height if necessary. This is useful for a compact summary, but it is not a good replacement for separate rows when you need to sort or filter each item.
  8. Check the result and decide whether it should stay live. A TEXTJOIN formula updates when its source cells change. If you need a fixed text result, copy the formula cell, then use Edit > Paste special > Values only in the destination. Confirm that the pasted value looks right before removing or changing the original rows. Keep the source data if you might need to audit or revise the combined result later.
  9. Undo or unmerge if the layout is wrong. Immediately after an unwanted change, use Ctrl+Z on Windows or Chromebook, or Command+Z on Mac. To reverse a merge later, select the merged cell and choose Format > Merge cells > Unmerge. Unmerging restores the cell grid, but it does not bring back values discarded during the merge. Restore those from Undo, a copy, or version history if available.

For a typical spreadsheet used as a list or database, keep one record per row and avoid merging its cells. Merged cells can interfere with sorting, filtering, selecting ranges, and filling formulas. Use a formula in a separate summary column or sheet when you need a combined display without disrupting the table.

Common Mistakes

  • Merging cells that contain several values. A merge is not a way to concatenate the contents. Google Sheets keeps the upper-left value and discards the rest of the selected cells’ contents. Join the values with TEXTJOIN first, or keep an untouched copy.
  • Choosing the wrong merge option. Merge vertically combines cells down a column; Merge horizontally combines them across a row. Merge all combines a rectangular selection into one cell. Check the selection outline and menu choice before confirming.
  • Using a merged range in a sortable table. A heading can be merged above a table, but merged cells inside the data range can cause problems when sorting, filtering, or adding rows. Keep the table’s records in separate, consistently structured rows.
  • Putting the formula inside its own source range. If a formula refers to A2:A4, enter it outside A2:A4. Otherwise, the formula may overwrite source data or produce a circular reference. Choose an empty destination cell and verify the range in the formula bar.
  • Expecting TEXTJOIN to combine whole records automatically. The formula joins the values in the range you give it. It does not identify duplicate names, add matching totals, or decide which rows belong together. For that kind of data cleanup or aggregation, first define the matching rule and use an appropriate summary method.

Tips

  • Pick a separator that makes the result readable. A space works for words that form a phrase; a comma and space work for a list; a line break works for items that should be stacked inside one cell. Avoid separators that already appear in your source values unless ambiguity is acceptable.
  • Use TRUE to skip blank cells. In TEXTJOIN, the second argument controls whether empty cells are ignored. With TRUE, blank cells do not create extra separators. If you use FALSE, empty cells are included in the joining pattern and can leave repeated separators.
  • Keep the original data until you have checked the combined output. A formula is easy to revise and updates when the source changes. If you need a permanent result, paste values only after checking it, and retain a backup if the original rows may be needed.
  • Separate presentation from analysis. If you want a heading to span columns, merge cells in a heading area. If the values are part of a dataset, use separate cells and rows so calculations, sorting, and filters remain straightforward.
  • Know the platform difference. These instructions use Google Sheets in a web browser. Excel also offers cell merging, but its commands are on the Home tab under the Merge & Center menu; the Google Sheets Format menu path does not apply there. TEXTJOIN is also available in current Excel versions, though separators and range references should be checked in the workbook.

Troubleshooting

The Merge cells option is unavailable. Check that you have selected at least two adjacent cells and that the selection shape matches the merge direction. For example, select a vertical range for Merge vertically. If you are working in a protected sheet or range, you may need permission from the owner before changing it.

Values disappeared after merging. Use Ctrl+Z on Windows or Command+Z on Mac immediately if possible. If you have made other edits since then, check whether the sheet has a prior version through File > Version history > See version history. You can also restore values from a backup or copy. Unmerge alone will not recover the discarded contents.

The formula shows an error or does not calculate. Check that the formula begins with an equals sign, the range is valid, and the opening and closing parentheses match. In Google Sheets, the formula shown here uses commas between arguments. If your spreadsheet’s locale expects semicolons, replace the argument-separating commas with semicolons while keeping commas inside quoted text as part of the separator.

The output has unexpected spaces or separators. Confirm the separator inside the first pair of quotation marks and inspect the source cells for spaces that may already be present. TEXTJOIN with TRUE skips empty cells, but it does not remove leading or trailing spaces in nonempty values. Clean the source text if necessary, or test the formula on a small range first.

The line breaks are not visible. The formula may have inserted them, but the cell is not displaying wrapped text or the row is too short. Select the cell, choose Format > Wrapping > Wrap, and adjust the row height. If the output is intended for a separate document or export, check how that destination handles line breaks.

Sorting or filtering behaves oddly after a merge. Unmerge cells in the data range and restore a consistent structure, with one record per row and the same fields in each column. If merged cells have already removed data, recover the missing values from a copy or version history before sorting.

Frequently Asked Questions

Does merging rows combine all the text in them?

No. Merging cells changes the cell layout and keeps only the value in the upper-left cell of the selected range. Use TEXTJOIN to put multiple values together while preserving the originals.

Can I combine rows from different columns into one cell?

Yes. Select a range that covers the values you want and reference it in TEXTJOIN. For example, a range such as A2:C2 can join a row’s values with a chosen separator. Place the formula outside the source range.

Can I combine rows without deleting the original data?

Yes. A TEXTJOIN formula produces a result in a separate cell and leaves the source cells intact. A visual merge can discard values in the selected cells, so use a copy or formula when preserving data is important.

Can I undo a merge in Google Sheets?

Use Ctrl+Z on Windows or Chromebook, or Command+Z on Mac, right after the merge. Later, choose Format > Merge cells > Unmerge. Unmerging restores the cell layout but cannot restore values that were removed by the merge.

Should I merge cells in a data table?

Usually not. Merged cells can make sorting, filtering, and editing records less reliable. Keep each record in its own row; reserve merges for presentation areas such as a heading above the table.

Can I combine matching rows and add their numbers?

TEXTJOIN joins values as text; it does not group matching records or total their numbers. Identify the field that defines a match and use a summary or aggregation approach suited to the data. Keep an unchanged copy before reorganizing a dataset.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.