Jonathan Hill
Jonathan Hill

Reputation: 1843

How to count the number of rows in an Excel table using excel

I'd like to reliably count the number of rows in a given excel table using excel formulas.

The rough equivalent of:

ActiveWorkbook.Worksheets("Sheet1").Range("Table1").Rows.Count

Using built-in Excel formulas.

Upvotes: 2

Views: 99

Answers (2)

user4039065
user4039065

Reputation:

For a non-volatile count of the rows in the table including the headers,

=ROWS(INDEX(Table1[#All], 0, 1))

For the rows in the .DataBodyRange without the header row,

=ROWS(INDEX(Table1, 0, 1))

Upvotes: 2

Jonathan Hill
Jonathan Hill

Reputation: 1843

I think I may have found a nice solution while researching this question:

=ROWS(INDIRECT("Table1"))

Feel free to post other options!

Upvotes: 2

Related Questions