Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Penny
 
Posts: n/a
Default countif two conditions

I have seen multiple posts on this but for some reason I can't seem to get it
to work. I have two columns and need to countif two conditions are satisfied.

Gender (COL A) School (COL H)
Male Carter Middle School
Female Carter Middle School
Female Centennial
Female Carter Middle School

I want to know the number of Females at Carter Middle School. My data is on
one worksheet and I want the formula to be on another. I have this but get
an error (#NUM)

=SUMPRODUCT(--('8th Grade Field Test 1 Michigan'!H:H="Carter Middle
School"),--('8th Grade Field Test 1 Michigan'!A:A="Female"))

Thanks, Penny

  #2   Report Post  
Max
 
Posts: n/a
Default

SUMPRODUCT doesn't allow entire col references (H:H, A:A, etc) to be used.
Try changing the references to say, H1:H200 and A1:A200 instead, in the
formula ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Penny" wrote in message
...
I have seen multiple posts on this but for some reason I can't seem to get

it
to work. I have two columns and need to countif two conditions are

satisfied.

Gender (COL A) School (COL H)
Male Carter Middle School
Female Carter Middle School
Female Centennial
Female Carter Middle School

I want to know the number of Females at Carter Middle School. My data is

on
one worksheet and I want the formula to be on another. I have this but

get
an error (#NUM)

=SUMPRODUCT(--('8th Grade Field Test 1 Michigan'!H:H="Carter Middle
School"),--('8th Grade Field Test 1 Michigan'!A:A="Female"))

Thanks, Penny



  #3   Report Post  
Penny
 
Posts: n/a
Default

Thanks! Now I am wondering if you could help me with something else?? If I
use the same data as before but add a column L for GPA. Is there a way for
me to calculate the mean GPA for those students at Carter Middle School?
Thanks.

Gender (COL A) School (COL H) GPA (COL L)
Male Carter Middle School 3.5
Female Carter Middle School 2.5
Female Centennial 2.5
Female Carter Middle School 3.8

"Max" wrote:

SUMPRODUCT doesn't allow entire col references (H:H, A:A, etc) to be used.
Try changing the references to say, H1:H200 and A1:A200 instead, in the
formula ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Penny" wrote in message
...
I have seen multiple posts on this but for some reason I can't seem to get

it
to work. I have two columns and need to countif two conditions are

satisfied.

Gender (COL A) School (COL H)
Male Carter Middle School
Female Carter Middle School
Female Centennial
Female Carter Middle School

I want to know the number of Females at Carter Middle School. My data is

on
one worksheet and I want the formula to be on another. I have this but

get
an error (#NUM)

=SUMPRODUCT(--('8th Grade Field Test 1 Michigan'!H:H="Carter Middle
School"),--('8th Grade Field Test 1 Michigan'!A:A="Female"))

Thanks, Penny




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Penny,

SUMPRODUCT cannot process a whole column, you have to define its range

=SUMPRODUCT(--('8th Grade Field Test 1 Michigan'!H1:H1000="Carter Middle
School"),--('8th Grade Field Test 1 Michigan'!A1:A1000="Female"))

--

HTH

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


"Penny" wrote in message
...
I have seen multiple posts on this but for some reason I can't seem to get

it
to work. I have two columns and need to countif two conditions are

satisfied.

Gender (COL A) School (COL H)
Male Carter Middle School
Female Carter Middle School
Female Centennial
Female Carter Middle School

I want to know the number of Females at Carter Middle School. My data is

on
one worksheet and I want the formula to be on another. I have this but

get
an error (#NUM)

=SUMPRODUCT(--('8th Grade Field Test 1 Michigan'!H:H="Carter Middle
School"),--('8th Grade Field Test 1 Michigan'!A:A="Female"))

Thanks, Penny



  #5   Report Post  
Max
 
Posts: n/a
Default

One way ...

Put in M1: Carter Middle School
Put in M2: Female

Put in M3, and array-enter (press CTRL+SHIFT+ENTER):
=AVERAGE(IF($H$2:$H$5=M$1,$L$2:$L$5))

M3 will return the mean GPA for "Carter Middle School"

Put in M4, and array-enter (press CTRL+SHIFT+ENTER):
=AVERAGE(IF(($H$2:$H$5=M$1)*($A$2:$A$5=M$2),$L$2:$ L$5))

M4 will return the mean GPA
for "Females" in "Carter Middle School"

Adjust the ranges to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Penny" wrote in message
...
Thanks! Now I am wondering if you could help me with something else?? If

I
use the same data as before but add a column L for GPA. Is there a way

for
me to calculate the mean GPA for those students at Carter Middle School?
Thanks.

Gender (COL A) School (COL H) GPA (COL L)
Male Carter Middle School 3.5
Female Carter Middle School 2.5
Female Centennial 2.5
Female Carter Middle School 3.8



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNTIF with two conditions Doodlemeyer Excel Worksheet Functions 2 March 20th 05 09:05 PM
COUNTIF - 2 conditions Doodlemeyer Excel Worksheet Functions 1 March 17th 05 02:49 PM
How can I use COUNTIF to sum for two conditions? Jeff Excel Worksheet Functions 4 December 30th 04 05:25 AM
COUNTIF using multiple conditions? Muse of Fire New Users to Excel 3 December 29th 04 08:49 PM
setting two conditions for countif Danny J Excel Worksheet Functions 5 December 6th 04 11:49 PM


All times are GMT +1. The time now is 06:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"