counta problem

P

Paul Hood

Hi all, hope someone can help.
I have a column of 81 cells, in each cell a formula that looks at the
contents of two other cells and if the difference is more than a given value
returns the contents of a third cell (a name). This all works well, I have
added conditional formatting so that if the cell is not empty then the cell
changes colour. Again works well, but when I try and add up the number of
cells that are displaying a name using counta I only get the total number of
cells (as if counta is counting the formula in each cell).
Now I have solved this by the addition of a second column that does the same
as the first but instead of a name it returns an "x" 9so countif works), but
it's not very neat and I know there must be a way of counting those names
directly.
Hope you can help
 
P

Peo Sjoblom

It does count formulas as well since the cell is not empty, there is a
workaround


=SUMPRODUCT(--(A1:A81<>""))


will count cells that are not empty disregarding formulas returning blanks
like ""



--


Regards,


Peo Sjoblom
 
P

Paul Hood

Thanks. I'll give that a go.
Paul
Peo Sjoblom said:
It does count formulas as well since the cell is not empty, there is a
workaround


=SUMPRODUCT(--(A1:A81<>""))


will count cells that are not empty disregarding formulas returning blanks
like ""



--


Regards,


Peo Sjoblom
 
P

Paul Hood

Sorry to be a pain,
I think I understand the nested brackets - looking for cells in the range
not "", but what are the two -- signs doing?
Paul
 
S

Shane Devenshire

Hi,

The result of A1:A81<>"" is a series of TRUE's and FALSE's. You need a
count of the number of TRUE's, so we need to get Excel to convert TRUE to 1
and FALSE to 0. You can think of the first minus as multiplying TRUE and
FALSE by -1, and the second minus converts the negative 1 to a positive 1.

If this helps, please click the Yes button

Cheers,
Shane Devenshire
 
P

Paul Hood

Thanks to you and Shane.
Shane sorry not sure what the yes button is but if I had one I would have
pressed it
Thanks again
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top