Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default countif with double criteria

I'm trying to find a formula to count cells if they respond to 2 criteria.
For example I have a list of transactions which are coded by a list of 2
criteria. The first list of code is : E, T, M, S, O and a second list of
codes is: 1, 2, 3.

Ex:

Transaction 1 E 2
Transaction 2 T 3
Transaction 3 S 1
Transaction 4 M 2
etc.


I want to count the number of transactions which are both equal to E and 2
at the same time.

Thanks !


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 196
Default countif with double criteria

Hi Benoit

Use SUMPRODUCT:

=SUMPRODUCT(--(B2:B1000="E"),--(C2:C1000=2))

Note that I have assumed that codes E,T etc are in col B and codes
1,2,3 are in col C. Note also you can't use whole column refs, so you
will need to adjust ranges to suit (can't use B:B for example, but
B2:B50000 is OK).

Hope this helps!

Richard


Benoit wrote:
I'm trying to find a formula to count cells if they respond to 2 criteria.
For example I have a list of transactions which are coded by a list of 2
criteria. The first list of code is : E, T, M, S, O and a second list of
codes is: 1, 2, 3.

Ex:

Transaction 1 E 2
Transaction 2 T 3
Transaction 3 S 1
Transaction 4 M 2
etc.


I want to count the number of transactions which are both equal to E and 2
at the same time.

Thanks !


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default countif with double criteria

Thanks. I have one more related question. If I also want to use these same
criteria to add amounts, what formula would I use?

For example:

Colum A B C D
Transaction 1 E 2 5122.00$
Transaction 2 T 3 1230.25$
Transaction 3 S 1 135.36$
Transaction 4 M 2 142.57$
etc.

I want to add $ of transactions which are both equal to E and 2 at the same
time.

Thanks again !

"RichardSchollar" wrote:

Hi Benoit

Use SUMPRODUCT:

=SUMPRODUCT(--(B2:B1000="E"),--(C2:C1000=2))

Note that I have assumed that codes E,T etc are in col B and codes
1,2,3 are in col C. Note also you can't use whole column refs, so you
will need to adjust ranges to suit (can't use B:B for example, but
B2:B50000 is OK).

Hope this helps!

Richard


Benoit wrote:
I'm trying to find a formula to count cells if they respond to 2 criteria.
For example I have a list of transactions which are coded by a list of 2
criteria. The first list of code is : E, T, M, S, O and a second list of
codes is: 1, 2, 3.

Ex:

Transaction 1 E 2
Transaction 2 T 3
Transaction 3 S 1
Transaction 4 M 2
etc.


I want to count the number of transactions which are both equal to E and 2
at the same time.

Thanks !



  #4   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default countif with double criteria

try this
=SUMPRODUCT(D2:D5,--(B2:B5="E"),--(C2:C5=2))

"Benoit" wrote in message
...
Thanks. I have one more related question. If I also want to use these
same
criteria to add amounts, what formula would I use?

For example:

Colum A B C D
Transaction 1 E 2 5122.00$
Transaction 2 T 3 1230.25$
Transaction 3 S 1 135.36$
Transaction 4 M 2 142.57$
etc.

I want to add $ of transactions which are both equal to E and 2 at the
same
time.

Thanks again !

"RichardSchollar" wrote:

Hi Benoit

Use SUMPRODUCT:

=SUMPRODUCT(--(B2:B1000="E"),--(C2:C1000=2))

Note that I have assumed that codes E,T etc are in col B and codes
1,2,3 are in col C. Note also you can't use whole column refs, so you
will need to adjust ranges to suit (can't use B:B for example, but
B2:B50000 is OK).

Hope this helps!

Richard


Benoit wrote:
I'm trying to find a formula to count cells if they respond to 2
criteria.
For example I have a list of transactions which are coded by a list of
2
criteria. The first list of code is : E, T, M, S, O and a second list
of
codes is: 1, 2, 3.

Ex:

Transaction 1 E 2
Transaction 2 T 3
Transaction 3 S 1
Transaction 4 M 2
etc.


I want to count the number of transactions which are both equal to E
and 2
at the same time.

Thanks !





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
Excel COUNTIF Function - a range as criteria ? joes Excel Worksheet Functions 2 March 6th 06 01:13 PM
Countif with more than one criteria Bleeding Maroon Excel Worksheet Functions 4 November 14th 05 01:48 AM
Countif with star operator in criteria [email protected] Excel Worksheet Functions 7 November 1st 05 03:16 PM
COUNTIF or SUMPRODUCT counting multiple criteria Peo Sjoblom Excel Worksheet Functions 0 May 31st 05 11:40 PM
countif variable criteria neda5 Excel Discussion (Misc queries) 3 May 3rd 05 10:55 AM


All times are GMT +1. The time now is 09:23 AM.

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"