SUM / COUNT formula

S

ss

I am using this formula

SUM(C3:C12)/COUNT(C3:C12)

Which in principle appears to work, it adds the cells with an entry and
divides to give an average. However if for example in cell C3 I have a
formula =A3+B3 but both cells A3 & B3 are empty then my formula takes it
that the formula is an entry and includes that in the maths.

I tried this but it didnt work:
SUM(C3:C12,"0")/COUNT(C3:C12)

Can this be altered so that cells with a formula but the result of the
formula is zero are not included in the count.
 
K

Ken Wright

From Excel 2007 onwards you could just use

=AVERAGEIF(C3:C12,"<>0",C3:C12)

Regards
Ken.........


"ss" wrote in message
I am using this formula

SUM(C3:C12)/COUNT(C3:C12)

Which in principle appears to work, it adds the cells with an entry and
divides to give an average. However if for example in cell C3 I have a
formula =A3+B3 but both cells A3 & B3 are empty then my formula takes it
that the formula is an entry and includes that in the maths.

I tried this but it didnt work:
SUM(C3:C12,"0")/COUNT(C3:C12)

Can this be altered so that cells with a formula but the result of the
formula is zero are not included in the count.
 
S

ss

From Excel 2007 onwards you could just use

=AVERAGEIF(C3:C12,"<>0",C3:C12)

Regards
Ken.........


in message I am using this formula

SUM(C3:C12)/COUNT(C3:C12)

Which in principle appears to work, it adds the cells with an entry and
divides to give an average. However if for example in cell C3 I have a
formula =A3+B3 but both cells A3 & B3 are empty then my formula takes it
that the formula is an entry and includes that in the maths.

I tried this but it didnt work:
SUM(C3:C12,"0")/COUNT(C3:C12)

Can this be altered so that cells with a formula but the result of the
formula is zero are not included in the count.


Thanks Ken that works fine.
 
K

Ken Wright

You're very welcome :)

"ss" wrote in message
From Excel 2007 onwards you could just use

=AVERAGEIF(C3:C12,"<>0",C3:C12)

Regards
Ken.........


in message I am using this formula

SUM(C3:C12)/COUNT(C3:C12)

Which in principle appears to work, it adds the cells with an entry and
divides to give an average. However if for example in cell C3 I have a
formula =A3+B3 but both cells A3 & B3 are empty then my formula takes it
that the formula is an entry and includes that in the maths.

I tried this but it didnt work:
SUM(C3:C12,"0")/COUNT(C3:C12)

Can this be altered so that cells with a formula but the result of the
formula is zero are not included in the count.


Thanks Ken that works fine.
 

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