I have a table that looks like this:

Column A

Dog     
Apple   

And some more words. But on the side of the table, I want to have a cell which tells me how many rows I have in Column A, and I want it to update as I add more rows. How could I do this using equations or functions?

link|improve this question

29% accept rate
feedback

migrated from stackoverflow.com Sep 9 '11 at 15:01

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 2 down vote accepted

=COUNTA(A:A)-1 will return the number of non-blank cells in Column A.

link|improve this answer
Ah, good one with the minus 1. – Lance Roberts Sep 8 '11 at 23:18
feedback

If you don't mind the header cell being counted you could just use:

=COUNTA(A:A)
link|improve this answer
feedback

If your rows contain text you will need {=COUNT(IF(A:A<>"",1,0))}

It needs to be entered as an array formula. You might also need to subtract some value from this to account for header rows.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.