How to Fix COUNTBLANK Counting Merged Cells as Multiple Blanks in Excel
Question details
The user wants to understand why the COUNTBLANK function evaluates a merged range as multiple hidden blank cells rather than a single cell, resulting in an unexpectedly high count.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Using the COUNTBLANK formula to analyze a data range that contains merged spreadsheet cells.
- Observed behavior
- The COUNTBLANK function returns a count of all individual underlying cells contained within the merged range, rather than treating the visually merged area as one single logical cell.
Before making layout changes, verify your data range to identify all merged cells. Unmerging cells might briefly alter your spreadsheet's visual structure, so it is recommended to save a copy of your workbook first.
Use Center Across Selection Instead of Merged Cells
Avoid the functional issues caused by merged cells by using a formatting alternative that centers text across multiple columns while keeping the underlying cell structure intact.
In spreadsheet logic, merging cells only alters the visual display. The underlying grid structure remains intact, causing functions like COUNTBLANK to evaluate every individual hidden cell. Using 'Center Across Selection' provides the exact same visual appearance without breaking formula logic.
Select the merged cell causing the counting issue. Navigate to the 'Home' tab on the ribbon and click the 'Merge & Center' button to unmerge the area.
Highlight the range of horizontal cells where you want your text to appear centered.
Right-click the highlighted selection and click 'Format Cells' from the context menu, or simply press 'Ctrl + 1' on your keyboard.
Go to the 'Alignment' tab. Under the 'Horizontal' drop-down menu, choose 'Center Across Selection' and click 'OK'.

Create a Custom VBA Function to Count Merged Areas
If you must keep cells physically merged, you can use a custom User-Defined Function (UDF) via VBA to force Excel to count each merged area as a single unit.
Manage Formulas and Cell Formatting easily with WPS Spreadsheet
WPS Spreadsheet provides a highly compatible and intuitive interface for managing complex data. You can easily apply formatting alternatives like 'Center Across Selection' to ensure functions like COUNTBLANK work exactly as intended without sacrificing your visual layout.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open the spreadsheet containing your problematic COUNTBLANK formulas.
- 2. Unmerge the cells: Highlight the merged cells, navigate to the 'Home' tab, and click the 'Merge and Center' icon to separate them into individual cells.
- 3. Access cell formatting: Select the cells you want to visually center, right-click the selection, and choose 'Format Cells'.
- 4. Change horizontal alignment: Navigate to the 'Alignment' tab, select 'Center Across Selection' from the 'Horizontal' drop-down list, and click 'OK'.
- 5. Verify your formula: Check your COUNTBLANK formula. It will now return the expected correct count since the underlying grid structure is fully exposed.

Frequently Asked Questions
Why does standard spreadsheet software count merged cells as multiple cells?
Merging cells only alters the visual display of the spreadsheet. The underlying grid structure remains completely unchanged. Because formulas evaluate the actual grid, functions like COUNTBLANK process every individual hidden cell within that merged visual area.
Is there a built-in formula to count a merged range as exactly one cell?
No, standard spreadsheet formulas evaluate underlying cells natively. There is no direct built-in function to count a merged range as one cell. You typically need a complex array formula or a custom VBA macro that references the MergeArea property.
Does 'Center Across Selection' work for vertically merged rows?
No, 'Center Across Selection' is specifically designed for horizontal alignment across multiple columns. To visually merge rows without actual merging, you must rely on standard formatting techniques like removing internal borders, though this will not center the text vertically.
Will unmerging my cells delete or lose my data?
No. When you unmerge cells, the data previously displayed in the merged area is safely placed into the top-left cell of that range. The other surrounding cells will simply become empty blanks.




