Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default count question

How do I do the following? :


A B C


1 Q1 Yes
2 Q2 Yes
3 Q3 No
4 Q1 Yes
5 Q1 Yes

How can I code, Count the no. of times cell A1:A5 have "Q1" in it with
"Yes" in the respective "C" cell?
(In this eg. Q1 and Yes exist together 3 times)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default count question

=sumproduct(--(a1:a5="Q1"),--(c1:c5="yes"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

wrote:

How do I do the following? :

A B C

1 Q1 Yes
2 Q2 Yes
3 Q3 No
4 Q1 Yes
5 Q1 Yes

How can I code, Count the no. of times cell A1:A5 have "Q1" in it with
"Yes" in the respective "C" cell?
(In this eg. Q1 and Yes exist together 3 times)


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default count question

Great ! This works! Thank you for your help!

On Jan 27, 7:08 pm, Dave Peterson wrote:
=sumproduct(--(a1:a5="Q1"),--(c1:c5="yes"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail hehttp://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:http://mcgimpsey.com/excel/formulae/doubleneg.html

wrote:

How do I do the following? :


A B C


1 Q1 Yes
2 Q2 Yes
3 Q3 No
4 Q1 Yes
5 Q1 Yes


How can I code, Count the no. of times cell A1:A5 have "Q1" in it with
"Yes" in the respective "C" cell?
(In this eg. Q1 and Yes exist together 3 times)--


Dave Peterson


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
count question del Excel Discussion (Misc queries) 3 September 11th 08 09:27 PM
{=COUNT(IF(etc))} question Ben Karlin Excel Discussion (Misc queries) 2 May 26th 06 11:46 PM
Count Question Grant Excel Worksheet Functions 2 December 9th 05 04:51 PM
Count If question Denise Excel Discussion (Misc queries) 3 August 16th 05 09:37 PM
To Bob ( count question ) Nigel Excel Discussion (Misc queries) 3 April 28th 05 01:32 PM


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