How to fill blank cells with the value above using a formula in Excel
Formula (Excel and Google Sheets)
=IF(A2="",D1,A2)In a helper column, take the value when there is one and the cell above otherwise: =IF(A2="",D1,A2), filled down.
- Result on the example
- one result per row in
D2, filled down toD8 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D8. Change any input and the result updates, or edit the formula to experiment.
How it works
Reports often show a group name only on its first row. When A2 has a value, the formula returns it; when it's blank, it returns D1, the result one row up in the helper column itself. Filled down, each blank picks up the last region above it.
=IF(A2="",D1,A2)Result"East"
A2"East"The value in A2.
A2=""FALSEThe = operator tests whether the two sides are equal.
D1"Region (filled)"not usedThe value in D1.
IF(A2="",D1,A2)"East"IF: Returns one value if a test is true, another if false.- logical_test
A2=""FALSE - value_if_true
D1"Region (filled)"not used - value_if_false
A2"East"
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(A2="",D1,A2). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(A2<>"",A2,D1) | East, East, East… | The same test written the other way round. |
Common mistakes
- The first data row must have a value, or the formula picks up the header.
- Paste the helper column as values before you sort, or the references to the row above point at the wrong rows.
- A cell holding a space isn't blank. Test
TRIM(A2)=""for imported data.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Fill blank cells with the value above using a formula
D2, show the region from column A, or the region from the row above when the cell is blank. Fill down to D8.Questions
Can I fill the blanks in place, without a helper column?
Select the column, press F5 > Special > Blanks, type = and press the up arrow, then Ctrl+Enter. Paste as values afterwards.
Is there a single formula for the whole column in Excel 365?
SCAN carries the last value down: =SCAN("",A2:A8,LAMBDA(a,v,IF(v="",a,v))).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.