average if zero

G

Guest

I'm looking for a formula similar to the following, but one that works.

=average(if((A1:A4="Jones")+(C1:C4>"0"),C1:C4))

Column A represent sales rep column, and I want to see the average sales for
all cells that have data entered in column C.

I've tried the ctrl+shift+enter, but it's still averaging with zeros, so
something is wrong with my formula.

Thank you.
 
G

Guest

substitute * for +
=average(if((A1:A4="Jones")*(C1:C4>"0"),C1:C4))
HTH,
Gary Brown
 
G

Guest

I've swapped out * for + but the zeros are still being calculated in and
reducing the average I need to see.
 
G

Guest

Did you remember to make it an array (ctrl-shift-enter)?
I tested it. It works.
HTH,
Gary Brown
 
G

Guest

Yes, if I don't use array, I receive #DIV/0!
If I do use array, it results in an average including zeros. Sigh!!!

I've just thrown together a baby spreadsheet that looks like this:

B C

4 PW 20%
5 JC 30%
6 PW 0%

=AVERAGE(IF((B4:B6="PW")+(C4:C6>"0"),C4:C6))

The result is 10%, not 20%
 
B

Bernie Deitrick

Lori,

In array formulas, + acts as OR, * acts as AND. You want AND, so use

=AVERAGE(IF((B4:B6="PW")*(C4:C6>"0"),C4:C6))

And since you are looking at numbers, get rid of the quotes

=AVERAGE(IF((B4:B6="PW")*(C4:C6>0),C4:C6))

And you may also be looking at rounded numbers, so try

=AVERAGE(IF((B4:B6="PW")*(C4:C6>=0.005),C4:C6))

HTH,
Bernie
MS Excel MVP
 
G

Guest

This is perfect; it did the trick. Thanks for all the help and the
distinction between * and + and the ""

Knowing this made all the difference.
 
B

Bernie Deitrick

Lori,

Glad to hear it worked, but in my first post, I used

=AVERAGE(IF((A1:A4="Jones")*(C1:C4>0),C1:C4))

which is essentially identical to

=AVERAGE(IF((B4:B6="PW")*(C4:C6>0),C4:C6))

What made the difference?

Bernie
MS Excel MVP
 
G

Guest

Probably a posting by another person in a duplicate thread indicating that I
should replace the * with a +. In that process quotes were inserted
automatically by Excel (maybe by not using an array command) and remained
there so when I reverted back to the * Excel didn't read the formula at all.
 

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

Similar Threads

AVERAGE IF formula and not equal to ZERO 2
How to calculate Average 5
Average Formula 1
average with zero 7
Compensating for Excel rounding errors 8
Average last 3 entries 3
Simple Average Question 3
Average 10

Top