AVERAGE & SUMPRODUCT
try
=average(if(K2:K13="WMT",M2:M13)) entered as array control-shift-enter
you could also use
=average(if(and(K2:K13="WMT",criteria 2),M2:M13)) entered as array
control-shift-enter
you could use Or instead of And if needed.
"Dave F" wrote:
I'm trying to calculate an average of a series of numbers, which
numbers are within a range. Not all members of the range should be
included in the average calculation, however.
I have the following:
=SUMPRODUCT(--(K2:K13="WMT"),(M2:M13))/COUNTIF(K2:K13,"WMT")
which obviously works but it would seem to me there is a more direct
way to do this using the AVERAGE function.
(I'm using SUMPRODUCT here instead of SUMIF because I may need to add
conditions in the future.)
Thoughts?
|