need to count/average if...

G

Guest

I want a function that will 1st off only look at numbers if they are next to
a cell with the label "case summary". 2nd I want an average of those numbers,
but I dont want to count any cells that have no number entered in them at
all... but I do want to count all cells that have numbers, including the
number 0% entered in them.

I tried using the following but I think it may be counting cells with no
numbers in them and thus lowering the average??? or maybe its a different
problem?

=AVERAGE(IF(B2:B124="Case Summary",C2:C124, "")) and hit control shift enter.
 
G

Guest

=SUMPRODUCT(C2:C124,--(B2:B124="Case
Summary"))/SUMPRODUCT(ROW(C2:C124)/ROW(C2:C124),--(B2:B124="Case Summary"))

this should work for you (works without hitting ctrl+shift+enter).
 
G

Guest

I dont understand... when I average the cells that it should be counting I
get a higher % than with the formula (I get a % in the 50 range and it gives
me a % in the 17 range?)
 
B

Bob Phillips

=AVERAGE(IF((B2:B124="Case Summary")*(C2:C124<>""),C2:C124, ""))

again as an array formula

--

HTH

RP
(remove nothere from the email address if mailing direct)


Need Help 123 said:
I dont understand... when I average the cells that it should be counting I
get a higher % than with the formula (I get a % in the 50 range and it gives
me a % in the 17 range?)
shift enter.
 
G

Guest

I forgot to check for empty cells in the count section. Sorry, try this.

=SUMPRODUCT(C2:C124,--(B2:B124="CaseSummary"))/SUMPRODUCT(ROW(C2:C124)/ROW(C2:C124),--(B2:B124="Case Summary"),--(ISNUMBER(C2:C124)))
 
G

Guest

That worked... thanks... this site is a life saver for me.....thanks everyone
for your help.
 
G

Guest

Thanks... this one works too!

Sloth said:
I forgot to check for empty cells in the count section. Sorry, try this.

=SUMPRODUCT(C2:C124,--(B2:B124="CaseSummary"))/SUMPRODUCT(ROW(C2:C124)/ROW(C2:C124),--(B2:B124="Case Summary"),--(ISNUMBER(C2:C124)))
 

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