Michael, The quickest way is with an array formula: =AVERAGE(IF(A1:A100<>0,A1:A100))
But personall I would prefer the DAVERAGE formula!
Let me know if interested.
OzGrid Business Applications
Negleted to say, you MUST enter any array formula by pushing Ctrl+Shift+Enter
Dave
OzGrid Business Applications
Array-enter (that is, hit CONTROL+SHIF+ENTER at the same time to enter)the following formula
=AVERAGE(IF(A1:A4>0;A1:A4))
Aladin
Thanks that worked Great!!!
Thanks for your Help
Michael, since the IF() function treats any non-zero
numeric value as TRUE and zero values as FALSE there
is no need for the conditional operator in Dave's
formulation.
{=AVERAGE(IF(A1:A100,A1:A100))} will suffice.
Allan, I would refrain from using a shorter formula. While it may save you 5 seconds intially, it is very bad practice as it does not give any indication as to what the argument is within the formula. You will find yourself looking at the formula later on and thinking, 'now what does this do? If another user has to use the spreadsheet they certainly wont!
Dave
OzGrid Business Applications