View Single Post
  #29   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default help on averaging function

"Dave Thomas" wrote...
His data could be all negative numbers for all I know. He said he just
wanted to eliminate 0's and blanks.

....

In that case,

=AVERAGE(IF(dataset<0,dataset))

or getting really pedantic,

=CHOOSE(1+SIGN(COUNTIF(dataset,"<0"))+2*SIGN(COUNT IF(dataset,"0")),
0+N("no positivess or negatives, so live with 0"),
AVERAGE(IF(dataset<0,dataset)),AVERAGE(IF(dataset 0,dataset)),
AVERAGE(dataset)+N("both positives and negatives, so should include 0s"))