A category typed once, with blanks underneath, should repeat until the next category. Austin, a blank, a blank, and Dallas become Austin, Austin, Austin, Dallas. That is the list on the fill down page. It is not the city list on How to count unique values in Excel. That list has no blanks: Austin, Dallas, Austin, Houston.
The copy-down looks up one row
The filled column starts with the first city. Each row under it uses the cell above when its own city cell is empty.
=IF(A3="",B2,A3)| A | B | |
|---|---|---|
| 1 | City | Filled |
| 2 | Austin | Austin |
| 3 | Austin | |
| 4 | Austin | |
| 5 | Dallas | Dallas |
=A2
=IF(A3="",B2,A3)
=IF(A4="",B3,A4)
=IF(A5="",B4,A5)
Row 3 is empty, so it keeps Austin. Row 4 is empty, so it keeps the Austin that row 3 just filled. Row 5 is Dallas, so the run changes. The test is ="". A formula that returns "" counts as empty. The number 0 does not. A cell with a space does not. The fill-down page states both of those limits.
This copy-down works in older Excel. It has to be filled in order, from the top. A row that points at the original column instead of the filled column stops at the first blank and returns a blank.
SCAN spills the same four results
SCAN walks the column once. The accumulator starts as an empty string. An empty cell keeps the accumulator. Any other cell replaces it.
=SCAN("",A2:A5,LAMBDA(acc,v,IF(v="",acc,v)))| A | B | |
|---|---|---|
| 1 | City | Filled |
| 2 | Austin | Austin |
| 3 | Austin | |
| 4 | Austin | |
| 5 | Dallas | Dallas |
=SCAN("",A2:A5,LAMBDA(acc,v,IF(v="",acc,v)))
=xl.fill.down(A2:A5)
The spill is Austin, Austin, Austin, Dallas. xl.fill.down is that SCAN under a name. The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA. The copy-down above is the sheet that still opens there.
The spill is as tall as the four input cells. It does not insert rows. A blank above the first Austin would stay blank, because the accumulator has not seen a city yet.