Fill blanks with Go To Special
Time-saving tools8 minPremium
Builds on Paste only what you need with Paste Special.
An operations analyst in Hamburg gets the weekly stock report as an export that names each warehouse only on its first row. Before she can sort or filter it by warehouse, every row needs its name.
How it works
Go To Special selects cells by what they hold. Select a range, press CtrlG (F5 also works on Windows), choose Special, and pick an option: Blanks for empty cells, Constants for typed values, Formulas for cells that calculate. The same box is under Home > Find & Select > Go To Special. With one cell selected, Excel looks through everything the sheet has used.
Blanks and CtrlEnter fill the gaps in one go. With the blanks selected, the first of them is the active cell. Type 0 and press CtrlEnter (CmdReturn on a Mac), and every blank gets a zero. To repeat the value above instead, type = and the address of the cell just above the active one, then press CtrlEnter. Every blank gets the formula, each copy pointing at the cell above itself, so the last name above a gap repeats down it. Then paste the column as values, so a sort can't scramble the formulas.
Rows you hid by hand still come along when you copy a range. To leave them out, select the range, press Alt; (CmdShift* on a Mac) to keep only the visible cells, then copy.
Example
The warehouse column has a name only where each block starts:
- Step 1: Select
A2:A8, then choose Go To Special > Blanks. Only the empty cells stay selected, withA3active. - Step 2: Type
=A2, the cell above the active one. - Step 3: Press CtrlEnter. Each blank gets the formula, moved to point at the cell above it.
- Step 4: Copy
A2:A8and paste it over itself as values, so the names stay put when you sort.
Common mistakes
- Go To Special with one cell selected looks through the whole sheet, so Blanks also picks the empty cells in other columns. Select the column first.
- Enter after typing the formula fills only the active blank. CtrlEnter fills them all.
- A locked reference such as
=$A$2makes every blank repeat the first name. Leave the dollar signs out. - Sorting before you paste the formulas as values breaks them, because each one still points at whatever cell is above it after the sort.
In short
- Go To Special (CtrlG, then Special) selects the blanks, typed values or formulas in a range.
- To fill gaps from above: Blanks,
=and the cell above, CtrlEnter, then paste as values. - Blanks, then
0and CtrlEnter, fills the gaps with zeros. - Alt; (CmdShift* on a Mac) keeps hidden rows out of a copy.
Practice
Premium4 exercises: 1 find-it task, 1 shortcut and 2 sheet edits.
Practice is part of Premium
Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.
Have one? Sign in