Unmerge Cells and Fill Down in Excel
Operator: Abdulla Al Fahad. How tools are built and checked
Reports exported from accounting and ERP systems love merged cells. A region name spans six rows, a month heading spans three columns, and it all looks tidy on paper. Then you try to sort, filter or build a pivot table, and Excel either refuses or treats five of those six rows as having no region at all, because a merged range stores its value only in the top-left cell.
This tool undoes that. Every merged range on the sheets you pick is split back into single cells, and the label that was in the top-left corner is written into each of them, so every row carries its own region, month or account name. An optional second pass fills the remaining gaps down each column for reports that left a label once and blank cells beneath it without merging anything.
Key features
- Merged range count shown for every sheet before anything changes
- Sheet checkboxes, all ticked by default
- Top-left value copied into every cell the merge covered, then the merge removed
- Optional fill down of blank cells in every column, off by default
- Per-sheet counts of merges removed, cells filled and blanks filled
- Merges with an empty top-left cell left blank and counted separately
- Formulas elsewhere in the workbook kept as formulas
What happens to values, formulas and formatting
Input is one .xlsx workbook of 25 MB or less. Legacy .xls files and password-protected workbooks are refused with a message explaining how to resave them. The used ranges of all sheets together may cover up to 500,000 cells; the page reports the actual total when a workbook goes over.
The merge list is read from each sheet's own record of merged ranges, so the counts you see before running are exactly the ranges that will be removed. Values keep their type: a number stays a number, a date keeps its date format, and text stays text. A merge whose top-left cell holds a formula keeps that formula in the top-left cell; the other cells receive the formula's saved result as a plain value, since copying the formula would shift its references.
The output is a new .xlsx written from cell values, number formats, formulas and column widths. Fills, borders, fonts, alignment, conditional formatting, charts and images may not carry through, because the file is rebuilt from the data rather than edited in place. Sheets you leave unticked are written back with their merges intact.
How it works
On loading, the page confirms the file opens with the ZIP signature an .xlsx must carry and is no larger than 25 MB, then parses it with SheetJS. It adds up the area of every sheet's used range and stops above 500,000 cells. Otherwise it lists each sheet with the number of entries in its merge list.
When you press Unmerge and download, the workbook is parsed again from the original bytes so repeated runs with different options always start from the untouched file. For each chosen sheet, every merged range is visited in turn. If its top-left cell holds a value, that value (with its number format, without any formula) is written into every other cell of the range, replacing whatever stray content was hidden under the merge. If the top-left cell is blank, the covered cells are cleared and the merge is counted as empty. The sheet's merge list is then deleted.
With fill down switched on, a second pass walks each column of the used range from top to bottom, remembering the last non-blank cell and copying it into every blank cell that follows. This runs after the unmerge, so labels released from merges feed into it.
SheetJS writes the result as a compressed .xlsx and the browser saves it with -unmerged added to the original file name.
Common use cases
- Preparing an ERP sales report with merged region labels for a pivot table
- Making a merged-header timetable sortable by day or room
- Cleaning a trial balance export where each account group is a merged block
- Turning a printed-style inventory list into rows a database import will accept
- Getting a survey summary with merged question cells ready for filtering
How to use this tool
- Pick the exported report. The table lists each sheet and how many merged ranges it holds.
- Untick any sheet whose merges you want to keep, such as a cover page with a merged title.
- Decide on fill down. Leave it off if the merges are the only thing hiding labels; switch it on if the report also leaves labels written once above blank cells.
- Press Unmerge and download, then read the counts that appear beside each sheet.
- Open the new file and sort or filter a labelled column to confirm every row now carries its label.
Example
Sheet Report, A1:B2 merged, A1 holds North
A B
1 [ North (merged A1:B2) ]
2 [ ]
3 East 12After unmerging
A B
1 North North
2 North North
3 East 12
Report: 1 merged range removed, 3 cells filledTips for best results
- Run once with fill down off and look at the result before trying it on. Many reports only need the merge pass.
- Untick cover and notes sheets; their merged titles are meant to stay merged.
- If the counts show merges with a blank top-left cell, those were usually decorative spacers rather than labels.
- After unmerging a header row that spanned several columns, rename the repeated headings so each column has a unique name before importing.
- Keep the original file. The output is rebuilt from data, so the original is your only copy of the formatting.
Common pitfalls
Fill down fills every blank below a value in every column, as far as the last used row. A notes column with occasional comments, a subtotal row with empty cells, or a column that simply ends early will all be filled with repeated values.
A merged heading that spans columns is repeated in each of them, so a header row can end up with three columns all called Q1. That is correct for the data but may need renaming for an import.
Cell styling is not preserved reliably. Coloured header bands, borders and bold fonts may disappear in the output because the file is written from values.
Cells copied from a merge whose top-left holds a formula receive the saved result, not a live formula. If the source changes later, only the top-left cell recalculates.
Hidden content under a merge is overwritten. Excel normally discards it when cells are merged, but a file produced by a script may have kept values there.
Common errors and how to fix them
- "This is an older .xls workbook or a password-protected file."
- Both are stored in the compound-file format rather than the ZIP format .xlsx uses. Open the file in your spreadsheet app, remove the password if there is one, and save as .xlsx before choosing it again.
- The page says the sheets span more cells than the limit.
- Check for formatting or a stray value far below or to the right of the data, which stretches the used range. Delete those rows and columns, or copy only the sheets with merges into a new workbook.
- "CSV files cannot hold merged cells."
- A CSV has no merge information at all; by the time a report is saved as CSV the covered cells are already empty. Use the .xlsx export of the report, or open the CSV and fill the gaps with the fill down option after saving it as .xlsx.
- The table shows 0 merged ranges on a sheet that clearly has merged-looking cells.
- The cells may use Center Across Selection, which looks like a merge but stores no merge record. Those labels already sit in one cell; switch on fill down if blank cells under them need filling.
Best practices
- Process only the data sheets, not title or summary pages.
- Compare the cells filled count with what you expect from the report layout before using the output.
- Turn fill down on only when you have checked that every column should be filled.
- Reapply any formatting you need after the data is clean, rather than before.
Merge pass or fill down: which do you need?
Exports handle repeated labels in two ways. Some merge the label across the rows it applies to; others write it once and leave the cells below empty. Both look the same printed, and both break sorting. The merge pass fixes the first kind exactly, touching only cells inside merged ranges. Fill down fixes the second kind but cannot tell a deliberate blank from a missing label, so it is off until you choose it.
If you are unsure, run the merge pass first and sort the result by the label column. Any rows that still sort to the bottom with an empty label point to the second kind, and a second run with fill down on will catch them.
What happens to formulas
Formulas outside merged ranges are written back unchanged. Inside a merge, only the top-left cell can hold anything in Excel, so a formula there stays where it is, and the cells it is copied into get its last saved result. Fill down copies values the same way. The tool never evaluates formulas itself; the results it copies are the ones stored in the file.
Frequently asked questions
Will my colours and borders survive?
Possibly not. The output is written from values, number formats, formulas and column widths, and cell styling such as fills, borders and fonts may be lost. Keep the original if the formatting matters.
Can I keep merges on some sheets?
Yes. Untick those sheets before running; they are written into the output with their merges in place.
What if a merged range has no value?
Its cells are left empty and the merge is still removed. The page shows how many merges on each sheet were like that.
Is the workbook uploaded?
No. The workbook is read in this tab, where SheetJS removes the merges and writes the new file for you to save. Nothing about it is written to localStorage, sessionStorage or IndexedDB, so closing the tab leaves no copy behind.