#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Double Count

I have the following data (sample):

w 1
w 1
w 2
w 1
w 1
c 3
w 2
c 1
c 1
w 3
c 1

I need a formula that calculates how many of the w's are 1
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Double Count

=sumproduct(--(a1:a20="W"),--(b1:b20=1))

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

Byron720 wrote:

I have the following data (sample):

w 1
w 1
w 2
w 1
w 1
c 3
w 2
c 1
c 1
w 3
c 1

I need a formula that calculates how many of the w's are 1


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Double Count

Thanks, It worked !!!

"Dave Peterson" wrote:

=sumproduct(--(a1:a20="W"),--(b1:b20=1))

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

Byron720 wrote:

I have the following data (sample):

w 1
w 1
w 2
w 1
w 1
c 3
w 2
c 1
c 1
w 3
c 1

I need a formula that calculates how many of the w's are 1


--

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
Add excel horizontal & vertical ruler snbahri Excel Worksheet Functions 8 December 1st 06 07:18 PM
How to count occurrences where 2 columns are required to be true? Brandoni Excel Worksheet Functions 1 November 4th 06 01:26 PM
Excel CSV file: How to preserve double quotation mark on Unix ftp? Shannona Excel Discussion (Misc queries) 2 October 3rd 06 07:54 PM
retirning count values from calcualted fields Antony Excel Discussion (Misc queries) 0 February 22nd 06 03:48 PM
Double clicking in a Pivot Table, Please HELP marko Excel Discussion (Misc queries) 3 December 27th 05 07:52 AM


All times are GMT +1. The time now is 12:42 PM.

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"