Excel Practice Test

โ–ถ

How to Merge Cells in Excel

Merging cells in Excel combines two or more adjacent cells into one larger cell, which is useful for creating headers that span multiple columns or rows, building visual structure in dashboards and reports, and formatting tables with clear section labels. The merged cell takes up the combined space of all original cells, and any content in the upper-left cell is preserved โ€” content in other merged cells is deleted.

You can merge cells horizontally across columns, vertically across rows, or both โ€” creating a large block cell that spans an entire section of your spreadsheet. This flexibility makes merging a go-to tool for report designers, though it comes with tradeoffs that matter when the spreadsheet also needs to function as a data analysis tool.

The most straightforward way to merge cells is through the Home tab on Excel's ribbon. Select the cells you want to merge, then click the Merge & Center button in the Alignment group. This merges the selected cells into one and centers the content horizontally. Merge & Center is the default merge option because centering text across a merged header is the most common formatting goal โ€” but it's not always the right choice, and Excel provides additional merge options through the dropdown arrow next to the Merge & Center button.

Before you merge, be aware of Excel's most significant merge limitation: sorting and filtering don't work reliably with merged cells. If your data range includes merged cells and you try to sort it, Excel will warn you that all merged cells need to be the same size. In practice, this means merged cells and data ranges designed for analysis don't mix well. For presentational elements (a title row at the top, a section header that spans several columns), merging is usually fine.

For data cells you'll need to sort, filter, or reference in formulas, avoid merging entirely and use Center Across Selection instead โ€” a formatting option that produces similar visual results without creating actual merged cells. See the Excel formulas guide to understand why merged cells complicate formula references and how to work around them.

Excel remembers which cells are merged when you save and reopen the workbook โ€” merges are permanent until you explicitly unmerge. If you're building a spreadsheet that other people will use or that will feed data to another system, discuss merge usage upfront. Many organizations have policies against merged cells in shared workbooks precisely because of the sort/filter and formula complications they create.

  • Fastest method: Select cells โ†’ Home tab โ†’ Merge & Center button
  • Keyboard shortcut: Alt + H + M + C (Merge & Center via ribbon keys)
  • Merge without centering: Use Merge Cells option (dropdown next to Merge & Center)
  • Better alternative for most headers: Center Across Selection (Format Cells โ†’ Alignment โ†’ Horizontal: Center Across Selection)
  • Unmerge: Select merged cell โ†’ Merge & Center dropdown โ†’ Unmerge Cells
  • Key limitation: Merged cells break sorting, filtering, and some formulas โ€” avoid in data ranges

5 Ways to Merge Cells in Excel

merge

Select cells โ†’ Home tab โ†’ Alignment group โ†’ Merge & Center button. Merges all selected cells into one and centers content horizontally. The most commonly used merge option for column headers and titles.

rows

Select multiple rows โ†’ Merge & Center dropdown โ†’ Merge Across. Merges each row separately rather than merging all selected cells into one single cell. Useful when you need separate merged cells across multiple rows simultaneously.

cells

Merge & Center dropdown โ†’ Merge Cells. Combines selected cells without automatically centering content โ€” useful when you want left-aligned or custom-aligned text in a merged cell. Content alignment can be adjusted separately after merging.

keyboard

Alt + H + M + C (Merge & Center) or Alt + H + M + M (Merge Cells) โ€” these sequential key presses activate ribbon options without using the mouse. Useful for users who prefer keyboard-driven workflows.

format

Format Cells dialog (Ctrl+1) โ†’ Alignment tab โ†’ Horizontal dropdown โ†’ Center Across Selection. Not a true merge โ€” creates the visual appearance of merged centered content without combining cells. Recommended over actual merging in data ranges.

Merge & Center vs. Center Across Selection

Center Across Selection is the professional alternative to Merge & Center that produces nearly identical visual results without creating the limitations that merged cells introduce. Both options display text visually centered across multiple columns. The difference is structural: Merge & Center creates one cell from several; Center Across Selection keeps the cells separate but centers the content of the leftmost cell across them visually.

Why does this distinction matter? Because Center Across Selection preserves the individual cells underneath the displayed header text. You can sort and filter data below a Center Across Selection header without triggering Excel's merged-cell warning. Formulas referencing the cells in a Center Across Selection range work normally. You can navigate to any cell in the range individually using keyboard shortcuts. None of this is true with genuinely merged cells โ€” they behave as a single entity that occupies the space of all original cells.

To apply Center Across Selection: select the cells that should appear merged, open Format Cells with Ctrl+1 (or right-click โ†’ Format Cells), click the Alignment tab, open the Horizontal dropdown, and choose Center Across Selection. The visual result is indistinguishable from Merge & Center in most cases, but the underlying spreadsheet structure remains clean and compatible with data operations.

When should you use actual Merge & Center instead of Center Across Selection? For print-formatted documents and report templates that are purely presentational โ€” not data-analysis tools โ€” the structural limitations of merging don't create problems in practice. A formatted invoice, a printed attendance roster, or a fixed-layout form benefit from the visual clarity of merged headers without needing sorting or formula capabilities. Use Center Across Selection everywhere else. This distinction is covered in depth in the Excel shortcuts guide alongside other formatting efficiency techniques.

Merge Options and When to Use Each

๐Ÿ”ด Merge & Center

Best for: Single row headers above data columns, dashboard titles, report section headers. Creates one merged cell; content is centered. Don't use in sortable data ranges.

๐ŸŸ  Merge Across

Best for: Applying row-by-row merges to multiple rows at once (e.g., merging column A-B in rows 1 through 10 simultaneously). More efficient than merging each row individually.

๐ŸŸก Merge Cells

Best for: When you want a merged cell with left-aligned or custom alignment rather than centered text. Same structure as Merge & Center but without automatic center formatting.

๐ŸŸข Center Across Selection

Best for: All situations where Merge & Center is tempting but sorting/filtering compatibility needs to be preserved. Preferred by Excel professionals over actual merging for most use cases.

Common Merge Scenarios

๐Ÿ“‹ Creating Headers

Column span headers โ€” where one header label applies to several data columns beneath it โ€” are the most legitimate use case for merged cells. For example, merging cells A1:D1 to create a "Sales Region" header above four quarterly sales columns.

Best practice for header merges:

  • Merge the header row but keep the subheader row (with individual column labels) unmerged
  • Apply a distinct background color and font to merged headers to visually separate them from data
  • Avoid merging any row that will be used as a filter row โ€” Excel can't filter merged header rows reliably
  • If the spreadsheet needs to be sorted by any column, put the merged header above the frozen header row rather than in the sort area

๐Ÿ“‹ Tables and Forms

For formatted forms and tables โ€” invoices, timesheets, expense reports, data entry forms โ€” merged cells are often appropriate because these documents are primarily for display or print rather than data analysis.

  • Label cells: Merge cells for form field labels (e.g., "Employee Name:" spanning B2:C2 with an input cell at D2)
  • Section headers: Merge row headers across the full width of the form to create clear section dividers
  • Address blocks: Merge multiple rows for address fields in invoices or letters

In form contexts, the key is that merged cells serve visual organization โ€” data entry users fill in the input cells, not the label cells, so sort/filter limitations don't arise.

๐Ÿ“‹ Dashboards

Excel dashboards frequently use merged cells for title and KPI display areas. Best practices for dashboard merges:

  • Merge cells in title areas and KPI boxes where the merged region is purely display, not referenced by analysis formulas
  • Use Center Across Selection for any numeric display area where the underlying data might be referenced in calculations elsewhere
  • Test how the dashboard prints after adding merged cells โ€” merged cells sometimes behave unexpectedly in page layout mode
  • Keep data tables on separate sheets from dashboards to avoid conflicts between presentation-optimised merged layouts and analysis-optimised unmerged data structures

How to Unmerge Cells in Excel

Unmerging cells separates a merged cell back into its individual component cells. The process is straightforward: select the merged cell, then click the dropdown arrow next to the Merge & Center button on the Home tab and choose Unmerge Cells. Alternatively, with the merged cell selected, clicking the Merge & Center button again toggles the merge off โ€” the button acts as both merge and unmerge depending on whether the selection is currently merged.

When you unmerge, the content that was in the merged cell (which was stored in the upper-left cell of the original range) moves back to just that upper-left cell. All other cells in the unmerged range become empty. If you needed the content to be in a different cell, move it manually after unmerging.

A common scenario requiring unmerge is receiving a spreadsheet that uses merged cells throughout and needing to sort or filter the data. The workflow is: select all cells (Ctrl+A), unmerge all merged cells (Merge & Center dropdown โ†’ Unmerge Cells), then use Excel's Go To Special (Ctrl+G โ†’ Special โ†’ Blanks) to select all the empty cells created by unmerging, enter a formula referencing the cell above (=โ†‘, meaning the cell directly above), and press Ctrl+Enter to fill all blanks simultaneously.

This fills the empty cells left by unmerging with the value they conceptually shared with the merged cell above, making the data sortable and filterable without losing information.

For spreadsheets you're building from scratch that will need to be analysed later, avoiding merges entirely is simpler than dealing with this unmerge-and-fill workflow. Using drop down lists for category fields and keeping headers unmerged creates a spreadsheet structure that's analysis-ready without modification.

After unmerging, take a moment to verify that any formulas referencing the formerly merged range still return correct values. A reference like =B2 that previously pointed to a merged cell spanning B2:D2 still returns the value from B2 after unmerging โ€” but references to C2 or D2, which were absorbed into the merge, now return empty cells rather than the merged value. Update any downstream formulas that relied on the merged behavior before distributing the spreadsheet to other users.

Merge Cells in Excel: Best Practice Checklist

Use Center Across Selection instead of Merge & Center in any spreadsheet that needs sorting or filtering
Only use actual merging in print-formatted documents, forms, and pure-display dashboards
Never merge cells in the same row as column filter dropdowns โ€” Excel can't filter merged rows
Test that all formulas referencing cells in the merged area still work correctly after merging
Avoid merging cells in data tables that will be imported into databases, Power Query, or other systems
Document merged cell locations if sharing workbooks with other users who may be unaware of merge limitations
When you receive a spreadsheet with merged cells that needs analysis, unmerge all and fill blanks before sorting
Use Merge Across instead of repeated individual row merges when merging across multiple rows
Consider whether visual structure goals could be achieved with borders and shading instead of merging

Merge & Center vs. Center Across Selection

Pros

  • Merge & Center creates a single clean cell โ€” clicking anywhere in the merged area selects the whole header
  • Merged cells are immediately obvious in the spreadsheet โ€” no hidden formatting to discover
  • Merge & Center works for both horizontal and vertical spanning โ€” span rows and columns simultaneously
  • Center Across Selection preserves underlying cells โ€” fully compatible with sorting, filtering, formulas
  • Center Across Selection is invisible to systems that import the spreadsheet data โ€” no merge artifacts

Cons

  • Merged cells block sorting and filtering โ€” Excel throws an error when you try to sort a range containing them
  • Formulas referencing a specific cell within a merged range behave unpredictably in some scenarios
  • Copy-pasting merged cells to non-merged ranges creates unexpected behavior
  • Center Across Selection only works horizontally โ€” you can't vertically center across rows with it
  • Center Across Selection requires more steps to apply than the Merge & Center button

Merge Cells in Excel: Formula Considerations

Merged cells and Excel formulas interact in ways that frequently surprise users. When you reference a merged cell range in a formula, Excel uses the address of the upper-left cell of the merged range โ€” not all cells in it. If you've merged B2:D2 and enter a formula like =B2, it returns the merged cell's value.

But =C2 and =D2 also return the same merged cell's value, because C2 and D2 no longer exist as independent cells โ€” they're absorbed into the B2 merged cell. This can create confusion in formulas that iterate through ranges or that expect individual cells at specific addresses.

COUNTIF, SUMIF, and similar functions that evaluate ranges cell by cell can produce incorrect results when applied to ranges containing merged cells, because they count or sum the merged cell's value once (for the upper-left cell reference) and skip the merged-over cells. This doesn't matter if the merged area is just a header row that you're not summing or counting anyway โ€” but it matters enormously if merged cells appear in a data column that you're trying to aggregate.

INDEX and MATCH formulas used for lookups are particularly vulnerable. If your lookup range includes merged cells, matches may return unexpected results because the lookup function may find the value in the upper-left cell of the merge but return a row number that doesn't correspond to what you intended. Professional Excel users building lookup logic test their formulas against ranges that include merged cells to verify they return the expected results before deploying the spreadsheet.

The cleanest solution is what professional Excel developers consistently recommend: keep merged cells out of data ranges entirely. Use merging only for display elements (titles, headers, form labels) that aren't referenced by formulas. For anything that needs to participate in calculations, filtering, or analysis, use unmerged cells with Center Across Selection for any visual centering needs.

This approach is used in our Excel budget template guide, which builds structured financial models that remain sortable and formula-friendly throughout. If you're auditing an existing workbook for merge issues, use Ctrl+F โ†’ Options โ†’ Format โ†’ set Alignment to Merged Cells to locate every merged cell in the workbook file quickly.

Test Your Excel Skills with Free Practice Questions

Merge Cells in Excel Quick Stats

5
Merge methods available in Excel (Merge & Center, Across, Cells, keyboard, Center Across Selection)
Ctrl+1
Keyboard shortcut to open Format Cells dialog (for Center Across Selection)
Alt+H+M+C
Sequential ribbon keyboard shortcut for Merge & Center
0
Cells retained in a merged range other than the upper-left cell
1
Cell in the merged range that retains its content (upper-left)
0
Columns that can be sorted when a filter row contains merged cells

Common Merge Cell Problems and How to Fix Them

"This operation requires the merged cells to be identically sized" is the error Excel throws when you try to sort a range that contains merged cells. The fix is to unmerge the problematic cells before sorting, or โ€” better โ€” to rebuild the spreadsheet using Center Across Selection rather than actual merging.

If you inherited a spreadsheet full of merged cells and need to sort it, the fastest remediation is: select all (Ctrl+A), unmerge all cells from the Merge & Center dropdown, use Go To Special to select blanks, fill them with the value above (=โ†‘, then Ctrl+Enter), then sort as needed.

"Cannot paste because the copy area and paste area are not the same size" often appears when you try to paste into a range that contains merged cells. Excel can't paste standard cell ranges into merged areas because the cell count doesn't match. The fix is to unmerge the destination cells before pasting, paste to a different area, or use Paste Special โ†’ Values to paste just the data without the structure.

If you need to delete duplicates in Excel from a dataset that contains merged cells, Excel's Remove Duplicates function may produce incorrect results or fail entirely depending on the merge pattern. Unmerge all cells and fill blanks before running duplicate removal โ€” the unmerge-and-fill technique described above prepares any merged dataset for standard Excel data operations.

Conditional formatting applied to a range that contains merged cells can also behave unexpectedly. Rules that highlight cells based on value comparisons may skip merged cells or apply the formatting to the entire merge block when only the upper-left cell technically meets the condition. If you're using conditional formatting for data validation or status visualization, keep those ranges separate from merged display areas. Structure your spreadsheet so that the data analysis layer (with conditional formatting, formulas, filters) is distinct from the formatting layer (with merges for visual headers and labels) โ€” even if they're on the same sheet.

Merging Cells Across Multiple Rows

Merging vertically โ€” across rows rather than columns โ€” is less common but useful for certain layouts. Vertical merges create tall cells that span multiple rows, often used in table-style layouts where a category label on the left spans several rows of detail data to its right. For example, a product category label in column A might span five rows while the five products in that category appear in columns B through D across those same rows.

To merge vertically, select the cells spanning the rows you want to merge (e.g., A2:A6), then apply Merge & Center (or Merge Cells if you don't want centering). The result is a single tall cell. Text alignment in the merged cell can be set independently โ€” vertical alignment (top, middle, bottom) is set through the Format Cells dialog's Alignment tab, separate from horizontal centering.

Vertical merges have the same sort/filter limitations as horizontal merges. A filter applied to the data columns will treat the row span of a vertical merge as a single row โ€” filtering may hide or show some rows but not others in the merged span, creating visual oddities. If you're building a report template that'll be printed or exported to PDF without sorting needs, vertical merges work fine. If the data needs to be dynamic, consider using grouping (Data โ†’ Group) or outline levels instead, which create collapsible row groups without merging.

For spreadsheets that are formatted for printing and shared as frozen-header reference documents, combining vertical cell merges with freeze panes creates professional-looking multi-level hierarchy displays. The frozen rows keep column headers visible while scrolling, and the merged category labels create clear visual groupings without the maintenance overhead of manually repeating the category label in every row.

One common pitfall with vertical merges is row height. When you merge cells vertically, Excel uses the height of the merged cell to display all text in the upper-left cell. If the merged cell contains long text, you may need to manually adjust the row height or enable Wrap Text in the merged cell to ensure all content is visible.

Auto-fit row height (double-click the row border in the row number column) sometimes doesn't work as expected on merged cells โ€” set the height manually by right-clicking the row numbers and choosing Row Height if the content appears clipped. Keep text in vertical merged cells short and descriptive to avoid these display issues.

Practice Excel Data Management Skills

Excel Questions and Answers

How do I merge cells in Excel?

Select the cells you want to merge, go to Home tab โ†’ Alignment group โ†’ click Merge & Center. This combines the selected cells into one and centers the content. For more merge options (Merge Across, Merge Cells without centering, Unmerge), click the dropdown arrow next to the Merge & Center button. The keyboard shortcut is Alt + H + M + C (sequential key presses) for Merge & Center.

How do I unmerge cells in Excel?

Select the merged cell, then click the dropdown arrow next to the Merge & Center button on the Home tab and choose Unmerge Cells. Alternatively, select the merged cell and click the Merge & Center button โ€” it toggles the merge off. When you unmerge, the content stays in the upper-left cell of the original range; all other cells become empty. You can fill those empty cells manually or use Go To Special โ†’ Blanks โ†’ fill with formula =โ†‘ โ†’ Ctrl+Enter.

Why can't I sort after merging cells?

Excel requires all merged cells to be the same size before sorting. If a range contains merged cells of different sizes (e.g., some cells merged across 2 columns, others across 3), Excel can't sort it. The best fix is to use Center Across Selection instead of actual merging โ€” it looks identical but doesn't create actual merged cells, so sorting works normally. If you need to sort an existing merged spreadsheet, unmerge all cells, fill blanks with the value above, then sort.

What is Center Across Selection and how is it different from Merge & Center?

Center Across Selection is a cell alignment option that visually centers the content of the leftmost cell across multiple columns without actually merging them. It looks identical to Merge & Center but keeps all underlying cells intact and separate. Access it via Ctrl+1 โ†’ Alignment tab โ†’ Horizontal dropdown โ†’ Center Across Selection. Unlike Merge & Center, it's compatible with sorting, filtering, and formulas. Most Excel professionals prefer it over actual merging for data spreadsheets.

Can I merge cells in an Excel Table?

No. Excel Tables (created with Ctrl+T or Insert โ†’ Table) do not support merged cells. If you try to merge cells within an Excel Table, the merge option is greyed out. If you have a range with merged cells and want to convert it to an Excel Table, you must first unmerge all cells, fill any blank cells created by unmerging, and then create the Table. The structured reference formulas and auto-filtering benefits of Excel Tables are worth removing merged cells for.

How do I merge cells in Excel without losing data?

Merging cells only preserves the content from the upper-left cell โ€” content in other cells is deleted. To avoid losing data: (1) Before merging, concatenate the content from all cells you plan to merge into the upper-left cell using a formula like =A1&" "&B1, then paste as values. (2) Or use Center Across Selection, which doesn't delete cell content because it doesn't actually merge cells. If you've already merged and lost data, check Excel's undo history (Ctrl+Z) immediately โ€” undo works if you haven't saved yet.
โ–ถ Start Quiz