Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

3 Answers 3

up vote 3 down vote accepted

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

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

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.

share|improve this answer

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

=COUNTA(A:A)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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