Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Countif Criteria (2 diff columns)

Column B is a list of dates in no particular order (10-01-07, 10-03-07,
etc.), column D lists different texts (TRAIN & CAR). How do I count the
number of dates according to criteria I specify (10-1-07),(TRAIN) - returning
the number of times 10-1-07 occured for TRAINS?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Countif Criteria (2 diff columns)

Use SUMPRODUCT if you have more than one criteria to check. For this
example, I'll assume your criteria are in cells A1 and A2.

=SUMPRODUCT(--(B1:B100=A1),--(D1:D100=A2))

Since SUMPRODUCT only works with numbers, and the statement B1:B100=A1
returns either TRUE or FALSE, the -- is used to convert TRUE/FALSE into 1 or
0. Thus, only when both conditions are TRUE (or 1) will they be counted.

HTH,
Elkar



"Teddy-B" wrote:

Column B is a list of dates in no particular order (10-01-07, 10-03-07,
etc.), column D lists different texts (TRAIN & CAR). How do I count the
number of dates according to criteria I specify (10-1-07),(TRAIN) - returning
the number of times 10-1-07 occured for TRAINS?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Countif Criteria (2 diff columns)

Excellent -
Thank you for the right answer. This was very helpful.

~Teddy-B

"Elkar" wrote:

Use SUMPRODUCT if you have more than one criteria to check. For this
example, I'll assume your criteria are in cells A1 and A2.

=SUMPRODUCT(--(B1:B100=A1),--(D1:D100=A2))

Since SUMPRODUCT only works with numbers, and the statement B1:B100=A1
returns either TRUE or FALSE, the -- is used to convert TRUE/FALSE into 1 or
0. Thus, only when both conditions are TRUE (or 1) will they be counted.

HTH,
Elkar



"Teddy-B" wrote:

Column B is a list of dates in no particular order (10-01-07, 10-03-07,
etc.), column D lists different texts (TRAIN & CAR). How do I count the
number of dates according to criteria I specify (10-1-07),(TRAIN) - returning
the number of times 10-1-07 occured for TRAINS?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Countif Criteria (2 diff columns)

Can you show me how to make this formula solid using INDIRECT?

"Elkar" wrote:

Use SUMPRODUCT if you have more than one criteria to check. For this
example, I'll assume your criteria are in cells A1 and A2.

=SUMPRODUCT(--(B1:B100=A1),--(D1:D100=A2))

Since SUMPRODUCT only works with numbers, and the statement B1:B100=A1
returns either TRUE or FALSE, the -- is used to convert TRUE/FALSE into 1 or
0. Thus, only when both conditions are TRUE (or 1) will they be counted.

HTH,
Elkar



"Teddy-B" wrote:

Column B is a list of dates in no particular order (10-01-07, 10-03-07,
etc.), column D lists different texts (TRAIN & CAR). How do I count the
number of dates according to criteria I specify (10-1-07),(TRAIN) - returning
the number of times 10-1-07 occured for TRAINS?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Countif Criteria (2 diff columns)

I'm not sure what you mean by "solid". Do you just want the cell references
to remain the same when copied? Then just use absolute references:

=SUMPRODUCT(--($B$1:$B$100=$A$1),--($D$1:$D$100=$A$2))

HTH,
Elkar


"Teddy-B" wrote:

Can you show me how to make this formula solid using INDIRECT?

"Elkar" wrote:

Use SUMPRODUCT if you have more than one criteria to check. For this
example, I'll assume your criteria are in cells A1 and A2.

=SUMPRODUCT(--(B1:B100=A1),--(D1:D100=A2))

Since SUMPRODUCT only works with numbers, and the statement B1:B100=A1
returns either TRUE or FALSE, the -- is used to convert TRUE/FALSE into 1 or
0. Thus, only when both conditions are TRUE (or 1) will they be counted.

HTH,
Elkar



"Teddy-B" wrote:

Column B is a list of dates in no particular order (10-01-07, 10-03-07,
etc.), column D lists different texts (TRAIN & CAR). How do I count the
number of dates according to criteria I specify (10-1-07),(TRAIN) - returning
the number of times 10-1-07 occured for TRAINS?

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 criteria in 2 columns EJ Excel Discussion (Misc queries) 3 December 20th 06 01:02 PM
Countif using criteria in multiple columns ImaGina Excel Worksheet Functions 1 September 14th 06 07:31 PM
Countif - Two Criteria in two columns are met. samprince Excel Discussion (Misc queries) 11 June 28th 06 04:58 PM
countif = < AND value in adjacent columns match criteria crafty_girl Excel Worksheet Functions 3 April 27th 06 08:40 PM
can countif function look at 2 separate columns for criteria blake7 Excel Worksheet Functions 2 March 16th 06 08:07 PM


All times are GMT +1. The time now is 06:24 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"