How to Merge Cells in Google Sheets

- Written by Puneet

Merging cells in Google Sheets helps format your data, particularly when you need to create a single cell out of multiple cells for labeling, adding headers, or organizing your data in a particular way.

In this tutorial, we will learn to learn all the ways to merge cells in Google Sheets.

Types of Options to Merge Cells

There are three ways to merge cells in Google Sheets:

  1. Merge All combines all the selected cells into a single cell. This is useful for several purposes, including: Creating Headers, Organizing Data, etc.
  2. Merge vertically combines selected cells in the same column into one larger cell. This option is useful for grouping related data together vertically or for formatting purposes.
  3. Merge horizontally merges selected cells in the same row into one larger cell. This is useful when you want to join cells in the same row without affecting cells in other rows.

Steps to Merge Cells in Google Sheets (Format Menu)

Merging cells in Google Sheets is quite simple. One of the easiest ways for this is to use the “Merge Cells” option from the Format menu:

  • Select Cells to Merge – Once your document is open, decide which cells you want to merge. You can select these cells by clicking and dragging the mouse across them. Alternatively, you can click on a cell, hold down the Shift key, and use the arrow keys to highlight multiple cells.
  • Go to the Format Menu: After selecting the cells, go to the “Format” menu at the top menu bar.
  • Click on the Merge Cells Option: In the “Format” dropdown menu, select the “Merge cells” option. This option allows you to merge your selected cells into one larger cell.
  • Select the Merge Option: In the “Merge cells” option, you will see three choices: “Merge all”, “Merge horizontally”, and “Merge vertically”. Choose the one that suits your needs. “Merge all” will combine all selected cells into one single cell. “Merge horizontally” will combine cells in the same row, and “Merge vertically” will combine cells in the same column.

When you click on the merge option you want to use, Google Sheets will show you a pop-up to remind you if there are values in the selected cell.

If you need to undo the merge, you can easily do so. Just use steps 3 and 4 to navigate back to the “Merge cells” option, then click on “Unmerge.” Alternatively, you can simply use Ctrl + Z to undo.

If you select columns and rows and then use this merging option, it will merge those as well. There is no limit to the number of cells, rows, and columns you can merge, but you always need to know how many cells you need to merge.

Merge Cells using the Merge Icon on the Toolbar in Google Sheets.

Using the merge icon on the toolbar is an even quicker method of merging cells than using the menu bar. This icon is a convenient and fast way to combine multiple cells directly from the interface without navigating multiple menu options.

  • Select the Cells: Select the two or more cells you want to merge. You can select cells across rows (horizontally), columns (vertically), or even select a range of cells to merge.
  • Look for the “Merge cells” icon: This icon is typically represented by two arrows joining into one. The location of this icon can vary slightly depending on whether you are using the new or classic toolbar layout, but it generally appears near the right of the toolbar.
  • Click the Merge Icon: A dropdown arrow next to the merge icon gives you three options once you click it.
    • Merge all: Merges the selected cells into one large cell.
    • Merge horizontally: Merges the selected cells into one cell but only combines cells across the row (horizontally).
    • Merge vertically: Combines the selected cells into one cell but only combines cells across the column (vertically).
  • Choose the merge option you need. If you click the merge icon directly without selecting from the dropdown, it will default to “Merge all.”

Once you merge cells, you can use the formatting option to change the formatting of the merged cells as you do it for a normal cell.

Read Also – Set Print Area in Google Sheets / Lock Cells in Google Sheets / Wrap Text in Google Sheets

Merge Cells in Google Sheets with a Keyboard Shortcut

Merging cells in Google Sheets quickly and efficiently using keyboard shortcuts can help you save time and effort.

Select the cells you want to merge using the Shift + Arrow keys. After that, press and hold the ALT, then press the O and then the M keys to open the Merge cells option from the Format menu.

Now, use A to merge all selected cells, H to merge cells horizontally, or V to merge cells vertically. So, the keyboard shortcut will be:

Alt > O > M > A

And if you are using the MAC, then it will be:

Option + Cmd + O > M > A

Merge Cells in Google Mobile (Android & iOS)

Tap on the first cell you want to merge, then drag the selection handles that appear at the corners of the selected cell to include all the cells you want to merge.

Once you select the cells you want to merge, click on the “A” button at the top of the screen to open the formatting options at the bottom of the screen.

After that, click on the “Cells” tab from the options you have on the bottom of the screen to go to the cells formatting options. From there, scroll down to get to the Merge Cells option. It’s like a toggle button to turn off.

But there’s a twist in this option in the Phone Application. When you select the cells, you will also get the same options on the quick toolbar at the bottom of the screen, and you just need to click on the merge button from there.

So, if you don’t want to use the option I shared above, you can simply use the merge button from there.

As you have learned, there are three different ways to merge the cells in Google Sheets. Unfortunately, when you are using the Mobile App, it’s not possible to use all the options. You can just use the Merge All option.

Editing Text in Merged Cells

Click on the merged cell you wish to edit. A merged cell typically covers multiple rows and/or columns but looks like a single cell. Or you can double-click inside the merged cell to start editing directly in the cell.

Once in edit mode, you can type new text, delete existing text, or modify the text as needed. If you are using Google Sheets from a Mobile device, double-tap on the cell. This will bring up the keyboard and allow you to start editing the text.

Points to Remember

  1. When you merge multiple cells, the data in the top-left cell will remain, and all other data in the merged cells will be deleted.
  2. Merged cells can complicate sorting and filtering data in your sheet.
  3. Formulas that refer to a range of cells may return errors if the reference includes merged cells.
  4. Adjust the text wrapping settings to control how the text fits within the merged cell.

Unmerge Cells in Google Sheets

Unmerging restores the original structure cells, and it’s especially useful when you need to sort, filter, or format the cells.

  • Select the Merged Cell: Click on any of the merged cells that you wish to unmerge.
  • Open the Merge Options: Go to the toolbar and click on the “Merge cells” icon, which looks like two arrows coming together. If the cells are merged, this icon will typically appear highlighted or a different color.
  • Unmerge the Cells: Click on the “Merge cells” icon once to unmerge the cells. Alternatively, you can click Format in the menu, hover over “Merge cells,” and select “Unmerge.”

You can also use the Google App Script below to unmerge all the merged cells from the worksheet in one go.

function unmergeAllSheets() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const allSheets = ss.getSheets();

allSheets.forEach((sheet) => {
const maxRows = sheet.getMaxRows();
const maxColumns = sheet.getMaxColumns();
const range = sheet.getRange(1, 1, maxRows, maxColumns);
range.breakApart();
});

SpreadsheetApp.getActiveSpreadsheet().toast('All cells have been unmerged in all sheets.');
}