Averageif Calcs

H

Help

I'm using windows XP (older version) which does not recognize the averageif
formula. I need a formula that calcs the average of four different data
points some of which contain zeros. Example:

A B C D avg
1 5 0 10 15 10
 
P

Pete_UK

Use this array* formula:

=AVERAGE(IF(A1:D1<>0,A1:D1))

*An array formula has to be committed using the key combination of
Ctrl-Shift-Enter (CSE) instead of the usual Enter. If you do this
correctly then Excel will wrap curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
amend the formula you will need to use CSE again.

Hope this helps.

Pete
 
H

Help

The formula still gives me an error
=(Percentages!D24+Percentages!J24+Percentages!P24)/countif(Percentages!D24,Percentages!J24,Percentages!P24,">0")
 
B

Bernie Deitrick

Countif requires a contiguous range.

=(Percentages!D24+Percentages!J24+Percentages!P24)/SUM(Percentages!D24>0,Percentages!J24>0,Percentages!P24>0)

Or, if there are only strings or blanks between the cells with the numbers:

=SUM(Percentages!D24:p24)/COUNTIF(Percentages!D24:p24,">0")

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top