Count occurrences with conditions in several columns

D

Dr DR

I have 2 columns of data: Temperature and State. Temperature has either 90 or
130 F values and State has either "Up" or "Down" values.

I would like to count the number of occurrences of "Up"s with a temperature
of 90F in the same row, for example. So in the following example, it is 2
Up's with 90F.

Temp - State
90 - Up
90 - Up
130 - Up
130 - Down

I know this can be done with a pivot table. This is an extra step that I
would like to eliminate.

Any suggestions?
 
B

Bob Greenblatt

On 6/11/08 5:07 PM, in article
(e-mail address removed), "Dr DR" <Dr
I have 2 columns of data: Temperature and State. Temperature has either 90 or
130 F values and State has either "Up" or "Down" values.

I would like to count the number of occurrences of "Up"s with a temperature
of 90F in the same row, for example. So in the following example, it is 2
Up's with 90F.

Temp - State
90 - Up
90 - Up
130 - Up
130 - Down

I know this can be done with a pivot table. This is an extra step that I
would like to eliminate.

Any suggestions?
Look in help for the COUNTIF function. It will do exactly what you want.
 
D

Dr DR

I am not sure how to utilize the "criteria" in the countif function for what
I am trying to do. Do you have a suggestion?

Thanks.
 
B

Bob Greenblatt

Use the countifs function and 2 sets of criteria:
=COUNTIFS(A2:A5,90,B2:B5,"Up")
 
D

Dr DR

The countif function is not recognized by my version Excel 2003.

I used the sumproduct function to get what I am looking for.

Thanks!
 
J

JE McGimpsey

Dr DR said:
The countif function is not recognized by my version Excel 2003.

I used the sumproduct function to get what I am looking for.

COUNTIFS() was introduced in XL07/08.

Note that this newsgroup is dedicated to Mac XL (hence the .mac. in the
group name).
 
D

Dr DR

Oh, got it, thanks!

JE McGimpsey said:
COUNTIFS() was introduced in XL07/08.

Note that this newsgroup is dedicated to Mac XL (hence the .mac. in the
group name).
 

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

Top