Search code examples
excelspreadsheetfill

Excel formula to fill cell below with cell above until value changes


if A is a column in an excel spreadsheet, I would like to fill the blank cells in the subsequent rows of A with the value of the last cell above it that had one. Once the column has a another cell with a value, use the value, and so on. This works, using Go To Special > Blanks > = up arrow > ctrl enter. Is there a way to do this with a formula? Thanks.

A A

1 1

_ 1

_ 1

2 2

_ 2

_ 2

_ 2

3 3

_ 3

etc etc


Solution

  • If you add a temp column and fill it with this, the new column should have the desired data. Assuming data is in column A, populate B1 yourself and then put this in B2 and fill down:

    =if(A2<>"",A2,B1)