View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default Excluding Zero's from Average (SumIF / CountIF)

This isn't quite the answer you are looking for ... but it averages the non
zero values in column B

=(SUMIF(B:B,"0",B:B))/COUNTIF(B:B,"0")

But then, so would: =AVERAGE(B:B) ;-)

Hopefully you can adapt it.

If you need to check a condition in column B and column F you probably need
to use SUMPRODUCT. If you search the archives there are lots of examples.

Regards

Trevor


"Alex" wrote in message
...
Hello everyone,

I was wondering if there was a way of excluding Zero's from averages.
I have tried IF and AND but have not been able to get it to work
correctly.

I want to be able to fist find column b, then get an average by group
where
value in F is not Zero.

This is what I have (it's working, but I can't seem to be able to count
only
if value < 0, using a countif)

=(SUMIF(B18:B65536,B8,F18:F72))/COUNTIF(B18:B65536,B8)

Sample data:

B C E F G H
Online Sales 329 138 1 150 1
Location Sales 999 18 2 130 1

Thanks