How to Average with Conditions

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I want to average a column x if column y meets a certain condition. I
tried the following:

=IF(M6:M2000=2,AVERAGE(R6:R2000))

But it is getting a Value error.

Thanks
 
I want to average a column x if column y meets a certain condition. I
tried the following:

=IF(M6:M2000=2,AVERAGE(R6:R2000))

But it is getting a Value error.

Thanks

Try...

=IF(M6:M2000=2,AVERAGE(R6:R2000),"")

which is an array function and must be entered using Ctrl + Shift +
Enter.
 
=SUMIF(M6:M2000,2,R6:R2000)/COUNTIF(M6:M2000,2)

Thanks for the help. I couldn't get this formula to work. I copied
and pasted it directly:

=IF(M6:M2000=2,AVERAGE(R6:R2000),"")

But this formula did work:

=SUMIF(M6:M2000,2,R6:R2000)/COUNTIF(M6:M2000,2)
 
But this formula did work:

=SUMIF(M6:M2000,2,R6:R2000)/COUNTIF(M6:M2000,2)

Sorry about that, I deluded myself because of the column R values I
had used.
Correct array equivalent is...

=SUM(IF(M6:M2000=2,R6:R2000))/COUNT(IF(M6:M2000=2,M6:M2000))

which of cause is a silly option.

Ken Johnson
 
=AVERAGE(IF(M6:M2000=2,R6:R2000))

array formula.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
=AVERAGE(IF(M6:M2000=2,R6:R2000))

array formula.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Thanks Bob.

My silly option was a really silly option!

Ken Johnson
 

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 Question 2
Averaging 5
Average Value 34
Average with Conditions 1
Average formula works but.... 3
Average Function 4
Averages 4
averaging numbers 5

Back
Top