ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Double Count (https://www.excelbanter.com/excel-discussion-misc-queries/124074-double-count.html)

Byron720

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

Dave Peterson

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

Byron720

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



All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com