How to Merge Cells in Google Sheets


- Written by Puneet

Merging cells in Google Sheets is a helpful for formatting 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 Option 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 the easiest way 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 located at the top menu bar.
  • Click on the Merge Cells Option: In the “Format” dropdown menu, go to the “Merge cells” option. This option is what 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 remined you if there are values in the selected cell.

And, 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”. or, you can simply use the Ctrl + Z to undo.

Note – if you select columns and rows and then use this merging option, it will merge those as well. There’s no limit of cells, rows, and columns to 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 to merge cells compared to using the menu bar. This icon is a convenient and fast way to combine multiple cells directly from the interface without navigating through multiple menu options.

  • Select the Cells: Select the two or more cells that you want to merge. You can select cells across rows (horizontally), columns (vertically), or even select 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 for you need. If you just click the merge icon directly without selecting from the dropdown, it will default to “Merge all”.

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

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 efforts.

Select the cells you want to merge by using the Shift + Arrow keys. After that, press and hold the ALT and then press O and then 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.

Now, 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, from the options you have got on the bottom of screen click on the “Cells” tab to go to the cells formatting options. And from there, scroll down to get to the Merge Cells option. It’s like toggle button to on-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 just 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 which I have shared above you can simply use the merge button from there.

As you have learned that 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 the all the options. You can just use the Merge All.

Editing Text in Merged Cells

Click on the merged cell you wish to edit. A merged cell will typically cover 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 you need. And 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 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 cell 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 and it will unmerge the cells. Alternatively, you can click Format in the menu, hover over Merge cells, and select Unmerge.

Or you can use the below Google App Script to Unmerge all the Merged Cells from the entire 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);

SpreadsheetApp.getActiveSpreadsheet().toast('All cells have been unmerged in all sheets.');
Last Updated: April 19, 2024