How to fill blank cells with the value above
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Un-merge pivot-style exports where the group label appears once and the rows below are blank.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =IF(A2="",B1,A2) | In a helper column B (formula shown for B2, referencing B1 above), fill down, then Paste Special → Values over A. |
| Google Sheets | =IF(A2="",B1,A2) | Identical helper-column pattern. |
| LibreOffice Calc | =IF(A2="",B1,A2) | Identical. |
How it works
The helper column carries values forward: each row shows its own A-value when present, otherwise it repeats the helper cell ABOVE — which already holds the last real label. Filled down, every blank inherits the nearest label upward (the verification shows one link of that chain). Finish by copying the helper over the original as values. Excel's non-formula route: select the column, Go To Special → Blanks, type = the-cell-above, then Ctrl+Enter fills every blank at once.
Verified, not just documented
We ran =IF(A3="",B2,A3) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Widgets — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned Widgets for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
IF — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to compare two columns row by row
- How to concatenate cells that meet a condition (TEXTJOIN IF)
- How to convert Yes/No (or TRUE/FALSE) to 1 and 0
- How to find duplicate values in a column
- How to flag overdue dates