Using Array Formulas in Google Sheets

I’m attempting to achieve a straightforward task that continues to confuse me. In column A, I categorize entries (e.g., 1, 2, 3), and in column B, I need to create an array formula. This formula should scan column A and return the most recent category listed. While I can successfully copy the formula into each row, I am looking to implement an array function that automatically populates the cells. Below is the code I’m using currently:

=ARRAYFORMULA(
  INDEX(
    INDIRECT("A$1:A" & ROW()),
    MATCH(9.99999999999999E+307, INDIRECT("A$1:A" & ROW()))
  )
)

Hey CreativePaintr33, try using =INDEX(FILTER(A:A,A:A<>""),COUNTA(FILTER(A:A,A:A<>""))) as ur array formula. It directly fetches the last non-empty value in column A without having to copy it row by row. cheap n’ cheerful fix!