Get the last non-empty cell in a column in Google Sheets

后端 未结 16 2204
温柔的废话
温柔的废话 2020-11-28 21:04

I use the following function

=DAYS360(A2, A35)

to calculate the difference between two dates in my column. However, the column is ever exp

16条回答
  •  温柔的废话
    2020-11-28 21:57

    I went a different route. Since I know I'll be adding something into a row/column one by one, I find out the last row by first counting the fields that have data. I'll demonstrate this with a column:

    =COUNT(A5:A34)
    

    So, let's say that returned 21. A5 is 4 rows down, so I need to get the 21st position from the 4th row down. I can do this using inderect, like so:

    =INDIRECT("A"&COUNT(A5:A34)+4)
    

    It's finding the amount of rows with data, and returning me a number I'm using as an index modifier.

提交回复
热议问题