This is a method that can be used when you want to know the last row where data is entered.
A simple way is the COUNTA function
A simple way is to use the COUNTA function.
![](http://en.eguweb.jp/wp-content/plugins/a3-lazy-load/assets/images/lazy_placeholder.gif)
COUNTA – Google Docs Editors HelpReturns the number of values in the dataset. Usage example COUNTA(A2:A100,B2:B100,4,26) COUNTA(1,2,3,4,5,C6:C20) Syntax COUNTA(value1, ) value1 – count the number
![](http://en.eguweb.jp/wp-content/plugins/a3-lazy-load/assets/images/lazy_placeholder.gif)
support.google.com
Returns the number of values in the COUNTA
dataset.
COUNTA(value1, [value2, …])
Put =counta() and put the range inside.
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.32.43-1024x579.jpg)
At this time, the point is not to enter the cell number at the end of the range (enter only the alphabet of the column) .
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.32.50-1024x498.jpg)
Then the spreadsheet will automatically recognize the last row .
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.32.57-1.jpg)
So if the number of rows increases and the data increases.
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.36.56.jpg)
The value of the part containing the function also changes dynamically.
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.37.04.jpg)
Add the upper line (+2 in this case)
After that, if you are counting from the 3rd line, add 2.
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.41.30-1024x408.jpg)
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.41.35-1024x342.jpg)
It’s okay to count from A1, but in case the A1 cell is a blank cell, for example, the cells are shifted and added.
![](https://eguweb.jp/wp-content/uploads/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2022-10-03-12.41.38.jpg)
Now we have the last line number!
summary
You have now dynamically retrieved the last row of a column that has data.
What if there are blank lines? There is a problem, so I would like to try it in another article about that point.
Please refer to it