sample:
=SUBTOTAL(109;G2:G2054)
https://www.excelcse.com/excel-subtotal-function/