averaging based on several criteria
Yes
=AVERAGE(IF((C2:C10000<Y2)*(M2:M10000=Y3),N2:N1000 0))
I have copied this from the cell.
y2 is a cell containing the number 70
y3 is a cell containing the word midazolm
The N column contains the numbers I want to average.
Thanks
"Bob Phillips" wrote:
Did you array enter it as shown?
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Paul" wrote in message
...
I've tried the formulaes as you suggested but get the result #N/A.
I can't get the averageifs to work at all (but I have office 2003).
Any suggestions?
Thanks,
Paul
"T. Valko" wrote:
Try one of these:
This array formula** works in all versions of Excel :
=AVERAGE(IF((C1:C15<70)*(M1:M15="X"),N1:N15))
Or, this normally entered formula in Excel 2007 only:
=AVERAGEIFS(N1:N15,C1:C15,"<70",M1:M15,"X")
Better to use cells to hold the criteria:
A1 = 70
B1 = X
=AVERAGE(IF((C1:C15<A1)*(M1:M15=B1),N1:N15))
=AVERAGEIFS(N1:N15,C1:C15,"<"&A1,M1:M15,B1)
** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)
--
Biff
Microsoft Excel MVP
"Paul" wrote in message
...
I need to averge based on several criteria.
In column C I have ages
In column M I have words for medication used by a patient
In column N I have numbers
I'd like to search column C for certain ages and then M for a drug and
then
average the dose (in column N) for those meeting criteria for both
colums
C
and M
i.e. average dose (column N) for people under 70 (column C) on drug x
(column M).
I'd really appreciate any help.
Paul
|