How to Fill Blank Cells With the Value Above in Excel
How to fill blank cells with the value from the row above in Excel: F5 trick, Power Query, and a free macro that handles multiple columns safely.
2026-04-28
The pivot-export problem
You exported a pivot table to flat data. The first row of each group has a label. Every subsequent row in the group is blank where the label should repeat. Now you can't filter, can't pivot, can't lookup. The pattern looks something like:
| Region | Account | Amount |
|---|---|---|
| Eastside | Acme Co | 1,200 |
| Beta LLC | 800 | |
| Gamma Inc | 600 | |
| Westside | Delta Corp | 1,500 |
| Echo Ltd | 900 |
Every row needs its own region label. Here are three ways to make that happen.
TL;DR — Key takeaways
- The classic F5 > Special > Blanks >
=A2> Ctrl+Enter trick works for a single column. - For multiple columns at once, the trick gets fiddly because Ctrl+Enter only fills with one reference at a time.
- Power Query has a built-in Fill Down that handles any number of columns elegantly.
- A free VBA macro does the same thing in one click and resets between columns so values don't leak across boundaries.
Why this happens
Several common workflows produce this layout:
- Pivot table > Show in Tabular Form > Repeat Item Labels OFF is the default. Switching it on fixes the source pivot but doesn't help you when the data is already flat.
- QuickBooks-style class-detail exports put the class name on the first row of each block and leave the rest blank.
- Hierarchical reports converted to spreadsheets preserve the visual hierarchy by leaving group labels blank.
The fix is always: walk down each column, when you see a blank, copy the value from above.
Method 1: F5 > Special > Blanks (Excel's built-in trick)
Works for a single column.
- Select the column with the blanks.
- Press F5 to open Go To.
- Click Special > Blanks, click OK. Every blank cell is now selected.
- Type
=then click the cell immediately above the active cell (e.g.,=A2if the active cell is A3). - Press Ctrl + Enter. Every selected blank cell gets the value from the cell above.
- (Optional) Copy the column, Paste Special > Values to lock the values in place.
The catch: for multiple non-adjacent columns, the Ctrl+Enter approach only fills with one reference. You can't tell Excel "fill column A from above and column C from above" in a single Ctrl+Enter. So you do them one at a time.
Method 2: Power Query Fill Down
If your data lives in or can move to a Power Query, this is the cleanest answer.
- Load the data into Power Query.
- Select the column(s) with blanks.
- Transform > Fill > Down.
- Close & Load.
Power Query handles multiple columns at once and the result re-runs cleanly when you refresh.
The catch: if you don't already use Power Query, the setup is more than the payoff for a one-off cleanup.
Method 3: The free VBA macro (multi-column, safe boundaries)
Download Fill Blank Cells With Value Above. Free .xlsm with one macro.
Steps:
- Select the columns or range with the blanks.
- Press Alt + F8, pick
FillBlanksWithAbove, click Run. - The macro walks each column independently and fills blanks with the most recent non-blank value. The popup reports how many cells got filled.
The "each column independently" detail matters: if column A is region and column C is product, the region label never leaks into the product column because the fill resets at every column boundary.
A common scenario: cleaning a flattened pivot export
You exported a multi-month sales-by-region pivot. Region in column A, month in column B, amount in column C. Region only appears once per group; the rest of the rows in each group have a blank in column A.
With the macro:
- Select column A from row 2 to the last row.
- Run the macro.
- Region labels propagate down. Pivot now works.
With F5:
- Select column A.
- F5 > Special > Blanks.
=A2, Ctrl+Enter.- Copy column A, Paste Special > Values.
About 30 seconds with F5, about 5 seconds with the macro. Either works for a single column. For multi-column blanks (region in A, sub-region in B, both with sparse labels), the macro is meaningfully easier.
Edge case: top row is blank
What if A2 (the very first row of your data) is blank? The macro can't fill from above because there's nothing above. So A2 stays blank, and the fill picks up from the first non-blank value. Most of the time this is fine. If A2 should have a value, set it manually before running.
The F5 method behaves the same way: =A1 would reference the header, which usually isn't what you want.
Edge case: cell with only whitespace
A cell with only a stray space is treated as blank by both the F5 trick (it's not actually blank because Excel sees the space as content) — actually wait, F5 misses these, treating them as non-blank. The macro DOES treat whitespace-only cells as blank. This is the right behavior for most real data because whitespace-only cells are almost always accidents.
Frequently asked questions
Will it touch formula cells?
A formula cell that evaluates to "" is treated as blank and gets filled. A formula cell that evaluates to a value becomes the next "last seen" value. Most of the time you're running this on text columns, not formula columns, so this rarely matters.
What if I want to fill RIGHT (across columns) instead of DOWN?
This macro only fills down. To fill right (each blank cell takes the value from the cell to its left), you'd need a different macro. The pattern is rare in real data because horizontal blanks usually mean "no data for this column", not "use the value from the previous column".
Can it fill with something other than the value above (like the value below)?
No, fill-from-above is the only supported direction. To fill from below, reverse the row order with Reverse Row Order, run the fill, then reverse back.
Does it preserve formatting?
Yes. The macro only writes values, not formatting. Number format, color, and font on the previously-blank cells stay as they were before the fill.
Can I undo it?
Yes, Ctrl/Cmd + Z right after running undoes the fill in one step. As always, work on a copy of the file before doing a bulk fill.
What to do next
If your data also has merged cells (common with pivot exports), run Unmerge Cells and Fill Down first. If after filling there are still blank rows, Remove Blank Rows cleans those up. After that, the data is ready to pivot or feed into another tool.