• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

averaging formula for blanks and zeros across two cells

Ben H

Member
Hi

I have the following formula for averaging cells or just bring back a number from one cell ...

=IF(AND(BK5="",BU5=""),"",IF(AND(BK5<>"",BU5<>""),AVERAGE(BK5,BU5),IF(BK5="",BU5,IF(BU5="",BK5))))

This works if the cells have blanks in them, but i also need it to do similar if any of the cells there is a 0.

Can you help?

Kind Regards

Ben
 
=IF(OR(AND(BK5="",BU5=""),AND(BK5=0,BU5=0)),"",IF(OR(AND(BK5<>"",BU5<>""),AND(BK5<>0,BU5<>0)),AVERAGE(BK5,BU5),IF(OR(BK5="",BK5=0),BU5,IF(OR(BU5="",BU5=0),BK5))))
 
Hi Ben,
I think you can use simple formula for average:

=IFERROR(AVERAGE(BK5,BU5),"")

i also need it to do similar if any of the cells there is a 0.

for this, you can use the following:
=IF(AND(BK5>0,BU5>0),AVERAGE(BK5,BU5),0)

use custom format if you want blank for 0:
#,##0.00;-#,##0.00;

Regards,
 
Back
Top