View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default Average only with specific critera

Try this:

=SUMPRODUCT(SUMIF(B1:B100,{1,2},C1:C100))/SUMPRODUCT(COUNTIF(B1:B100,{1,2}))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Stephen" wrote:

Thank you, I did get it to work.

How would I do it if I want to average the percentages if either 1 or 2 were
in the b column?

Thanks in advance.
--
Thanks!

Stephen


"Ron Coderre" wrote:

Try this:

=SUMIF(B1:B100,1,C1:C100)/COUNTIF(B1:B100,1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Stephen" wrote:

Hi. I am trying to average a set of numbers but only if the number in the
column to the left is equal to 1. For example:

b1:b100 I have either the number 1, 2, 3, or 4,
c1:c100 I have percentages

I want to average only the percentages that have a 1 to the left of it in
the b column.

Thanks in advance...
--
Thanks!

Stephen