View Single Post
  #29  
Old July 18th, 2007, 02:49 AM posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_]
external usenet poster
 
Posts: 1,439
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(dataset0,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(dataset0,dataset)),AVERAGE(IF(dataset 0,dataset)),
AVERAGE(dataset)+N("both positives and negatives, so should include 0s"))