Count occurrences with conditions in several columns

Count occurrences with conditions in several columns

Post by RHIgRF » Fri, 13 Jun 2008 06:07:00


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?
 
 
 

Count occurrences with conditions in several columns

Post by Bob Greenb » Fri, 13 Jun 2008 20:27:03

On 6/11/08 5:07 PM, in article
XXXX@XXXXX.COM , "Dr DR" <Dr


Look in help for the COUNTIF function. It will do exactly what you want.

--
Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom

 
 
 

Count occurrences with conditions in several columns

Post by RHIgRF » Sat, 14 Jun 2008 00:07:00

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.
 
 
 

Count occurrences with conditions in several columns

Post by Bob Greenb » Sat, 14 Jun 2008 00:27:04

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


--
Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom
 
 
 

Count occurrences with conditions in several columns

Post by RHIgRF » Sun, 15 Jun 2008 02:46:00

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

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

Thanks!
 
 
 

Count occurrences with conditions in several columns

Post by JE McGimps » Sun, 15 Jun 2008 04:15:21

In article < XXXX@XXXXX.COM >,



COUNTIFS() was introduced in XL07/08.

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

Count occurrences with conditions in several columns

Post by RHIgRF » Sun, 15 Jun 2008 06:21:01

Oh, got it, thanks!