Thread: Averages
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harry Stevens Harry Stevens is offline
external usenet poster
 
Posts: 21
Default Averages

Paige,
I have a similar issue and this is what I use:

IF(SUM($B3:$M3) 0, SUM($B3:$M3) / (COUNT($B3:$M3) -
COUNTIF($B3:$M3,0)),"")

HTH
Harry

Paige06 wrote:
Ok, I just figured out why I'm getting an incorrect average using example:
average(B38:M38), because it's taking all 12 months and averaging. I do not
want that. I want it to average as I enter numbers or not in month to month.
Understand?????

"joeu2004" wrote:

On Jul 30, 9:19 am, Paige06 wrote:
I need to average a row some cells have 0's but I need to include them in
the function so it averages correctly. The formula I currently have is this
=AVERAGE(IF(B38:M38<0,B38:M38,"")). It is working with the cells with
numbers, but not the cells that do not. Example : jan - 5, feb - 7, mar. 0,
april - 18 = 30 divided by 4 = 7.50. My sheet will only calulate 3. Any
suggestions?????

You intentions are unclear to me.

First, your formula says that you want to exclude zero-valued cells
from the average. But your first statement says "I need to include
them", and your example ("divided by 4") and your intended result
(7.5) suggests that you do indeed want to include zero-valued cells.

Second, from the presentation of the example, it is unclear to me
whether the range B38:M38 includes just cells with numeric values
(e.g. 5, 7, 0 and 18 in the example) or also cells with text (e.g.
literally "jan", 5, "feb", 7, "mar", 0, "april", 18). That may or may
not have anything to do with your problem.

Finally, you provide nothing in your example that would explain how
your formula returns 3. I suspect the value of 3 is coming from
different example, not the example supplied in your posting.

Having said that, looking only at the syntax of the example formula
above, did you remember to enter it as an array formula (commit with
ctrl-shift-Enter, not just Enter)?

If you do not, then the formula above is logically equivalent to:

=if(B38<0, average(B38:M38), 0)

That may or not may not be the root cause of your problem, given that
I do not understand your intentions.