How to Merge Cells in Google Sheets
To merge cells in Google Sheets, select them and click Format › Merge cells › Merge all. That's the easy part. The catch is what you lose: Sheets keeps one value and deletes the rest, and merged cells can stop sorting and filtering. This guide covers all three merge types, the keyboard routes, the phone app and the fix for each error message.
Last updated: October 2026
Quick Answer
To merge cells in Google Sheets: select the cells, then click Format › Merge cells › Merge all, or click the Merge cells button in the toolbar. Only the top-left value survives, so join the text first if you need all of it.
At a glance
Merge Cells From the Format Menu or Toolbar
On a computer, the merge options live under Format › Merge cells, as Google's merge rows and columns help shows.
Select the cells
Drag across the cells you want to join, such as A1:D1 for a title over four columns.
Open the Merge cells menu
Click Format › Merge cells.
Pick a merge type
Click Merge all, Merge horizontally or Merge vertically. If more than one of the cells has data, Sheets warns you first.
The toolbar does it in one click. Its Merge cells button merges everything you selected, the same as Merge all, and the arrow beside it (Select merge type) lists the other options.
Merge All vs. Merge Horizontally vs. Merge Vertically
The three only differ when you select several rows and several columns. These examples come from Google's Apps Script reference, which has a command for each:
| Option | What you get | Example |
|---|---|---|
| Merge all | One cell for the whole selection | A1:B3 becomes one cell |
| Merge horizontally | One merged cell per row | F5:H6 becomes F5:H5 and F6:H6 |
| Merge vertically | One merged cell per column | B1:D10 becomes B1:B10, C1:C10 and D1:D10 |
Merge horizontally only has something to join when you select at least two columns, and Merge vertically when you select at least two rows. In practice, Merge all suits a title over a table. Merge horizontally fits labels that span the same columns on several rows, and Merge vertically fits a group label beside a block of rows.
What Happens to the Data in Merged Cells
If two or more of the selected cells hold something, Sheets stops and asks: Merging cells will only preserve the top-leftmost value. Merge anyway? Go ahead, and each merged cell keeps the value of its top-left cell. If that cell is empty, Sheets uses the first filled cell instead, reading across and then down. Everything else is deleted.
Unmerging later won't bring those values back, but Undo (Ctrl + Z, or ⌘ + Z on a Mac) will if you use it right away. After that, your way back is version history: click Last edit at the top right and restore an earlier version.
Merge without losing data
Join the text first, then merge. Here it is for A1:C1:
In an empty cell, join the values with =TEXTJOIN(" ", TRUE, A1:C1). The TRUE skips blank cells. For a few cells, =A1&" "&B1&" "&C1 does the same.
Copy that cell, click A1, and press Ctrl + Shift + V (⌘ + Shift + V on a Mac) to paste the text as a plain value. A formula would break here, because the merge clears the cells it reads.
Merge A1:C1 and accept the warning. The merged cell now shows all the text. Delete the helper cell.
TEXTJOIN's arguments are in Google's TEXTJOIN help. Often you can skip the merge entirely: a formula cell can show the joined text on its own, and a long header can wrap inside one cell. See how to wrap text in Google Sheets.
How to Unmerge Cells in Google Sheets
Click the merged cell.
Click Format › Merge cells › Unmerge. Or click the Merge cells button in the toolbar, which is highlighted while a merged cell is selected.
The value stays in the top-left cell and the others come back empty. To unmerge every merged cell on a tab, select the whole sheet first with Ctrl + A (⌘ + A on a Mac).
Keyboard Shortcuts for Merging Cells
Sheets has no dedicated merge shortcut. There's none in Google's keyboard shortcuts for Google Sheets, and the Ctrl + Alt + M that some guides give inserts or edits a comment. Three keyboard routes do work.
1. Menu keys
Open the Format menu, press M for Merge cells, then A for Merge all. Press H, V or U instead of A for horizontally, vertically or Unmerge. Google's shortcut list gives the keys that open the Format menu:
| Computer | Merge all |
|---|---|
| Windows or ChromeOS, in Chrome | Alt + O, then M, then A |
| Windows, other browsers | Alt + Shift + O, then M, then A |
| Mac | Ctrl + Option + O, then M, then A |
2. Tool finder
Press Alt + / (Option + / on a Mac), type merge, and pick the option you want. Some versions label this box Search the menus.
3. Your own shortcut, with a macro
If you merge all day, give it a real shortcut. Google's macro guide lets you link up to ten macros per sheet to shortcuts of the form Ctrl + Alt + Shift + a number.
Click Extensions › Apps Script, paste the code below into the editor, and save the project.
Back in the sheet, click Extensions › Macros › Import macro, then Add function next to mergeAll.
Click Extensions › Macros › Manage macros, give mergeAll a shortcut number, and click Update.
Select some cells and press your new shortcut. The first run asks you to authorize the script.
/** @OnlyCurrentDoc */
function mergeAll() {
SpreadsheetApp.getActiveRange().merge();
}It works like Merge all, so the one-value rule above still applies. Swap merge() for mergeAcross(), mergeVertically() or breakApart() to make horizontal, vertical or unmerge versions. The @OnlyCurrentDoc line limits the script to this one spreadsheet.
How to Merge Cells on iPhone, iPad and Android
The steps are the same on every phone and tablet, per Google's formatting help for the Sheets app:
Open the spreadsheet in the Google Sheets app.
Tap a cell, then drag the blue markers across the cells you want to merge.
Tap Format.
On the Cell tab, tap Merge cells.
Tap the sheet to save the change.
One option only
Google's app help lists a single Merge cells option, with no horizontal or vertical choice, and it doesn't cover unmerging. Use a computer for all three.
Can't Merge, Sort or Filter? What the Messages Mean
Sheets explains most refusals in a message. Here is what each one is asking for.
“You must select all cells in a merged range to merge or unmerge them.”
Your selection cuts through a merged cell. Widen it to cover the whole merge.
“You can't merge cells within a table.”
Tables can't contain merged cells. Merge outside the table, or turn it back into plain cells with Revert to unformatted data in the table menu.
“You can't merge frozen and non-frozen rows.”
The merge crosses the freeze line (columns have the same rule). Merge on one side of it, or move the line from View › Freeze.
“Sorry, you can't freeze rows which contain only part of a merged cell.”
Freeze enough rows to take in the whole merge, or unmerge it.
“You can't merge cells over a filtered row.”
A filter is hiding some of the selected rows. Remove it with Data › Remove filter, merge, then filter again.
“You can't sort a range containing vertical merges. There is a vertical merge at A2:A5.”
Unmerge cells that span more than one row. Merges inside a single row can stay, as long as each sits fully inside the range you sort.
“You can't create a filter within a range containing merges.”
A merged cell crosses the edge of your range. Include all of it, or unmerge it. A vertical merge in the header row blocks filters too.
“Array result was not expanded because it would overwrite merge range”
A formula such as FILTER needs those cells to spill into, so it shows #REF!. Unmerge them or move the formula.
Frequently Asked Questions
Is there a keyboard shortcut to merge cells in Google Sheets?
Not a built-in one. In Chrome on Windows, press Alt + O, then M, then A to run Merge all (Ctrl + Option + O, M, A on a Mac). For a single shortcut, turn the merge into a macro.
How do I merge cells without losing data?
Join the values first with =TEXTJOIN(" ", TRUE, A1:C1), paste the result into the top-left cell as a value, then merge. A plain merge keeps only the top-left value.
How do I unmerge cells in Google Sheets?
Select the merged cell and click Format › Merge cells › Unmerge, or click the highlighted Merge cells button in the toolbar. The value stays in the top-left cell.
Why is Merge cells grayed out?
You have one ordinary cell or several separate ranges selected, the range is protected, or you can only view or comment on the file. Sheets also blocks merges inside tables.
Can you merge cells in the Google Sheets app?
Yes. Select the cells, tap Format, then Merge cells on the Cell tab. Google's app help lists only that one option, with no horizontal or vertical choice.
Why can't I sort after merging cells?
Sheets won't sort a range that contains vertical merges, meaning merged cells taller than one row. Unmerge them, or keep merged titles outside the range you sort.

About the author
Kinshuk Snehi
Founder of Deckoholic
Kinshuk has a strong background in product marketing, customer onboarding, and the growth function across B2B SaaS. He has been part of an early-stage company's journey from zero to multi-million-dollar revenue, building demand generation, customer acquisition, and retention from the ground up, and has run interactive demos and product tours in production. He writes here about software, productivity, and the tools teams use every day.
Connect on LinkedInRelated Tutorials
Writing how-tos for your team's sheets?
Record the steps once with the Deckoholic Chrome extension. It trims the ums and long pauses, adds zooms and captions, and exports an MP4 or a step-by-step help doc.
Try Deckoholic Free