ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Counting based on multiple criteria (https://www.excelbanter.com/excel-discussion-misc-queries/84301-counting-based-multiple-criteria.html)

cubsfan

Counting based on multiple criteria
 

I have two columns that have drop down boxes with either a Yes or a No
as the only inputs. I need to be able enter a formula that counts up
the total "No" inputs in one column but count it up only if the other
column says yes. Any suggestions.


--
cubsfan
------------------------------------------------------------------------
cubsfan's Profile: http://www.excelforum.com/member.php...o&userid=33272
View this thread: http://www.excelforum.com/showthread...hreadid=534737


wjohnson

Counting based on multiple criteria
 

I would make a "Helper" column and then just count the "true" values:
Example:
Cell A1=no
Cell B1=yes
In cell C1 - enter the following formula =AND(A1="no",B1="yes") - then
copy down as far as you need.
This should equate to "TRUE" in C1 - Then you just use a formula to
count the number of TRUE's in Column C - using the COUNTIF function.


--
wjohnson
------------------------------------------------------------------------
wjohnson's Profile: http://www.excelforum.com/member.php...o&userid=29640
View this thread: http://www.excelforum.com/showthread...hreadid=534737


Dave Peterson

Counting based on multiple criteria
 
=sumproduct(--(a1:a10="no"),--(b1:b10="yes"))

will count the number of No's in column A only if there's a Yes in column B.

Adjust the ranges to match--but you can't use whole columns.

=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

cubsfan wrote:

I have two columns that have drop down boxes with either a Yes or a No
as the only inputs. I need to be able enter a formula that counts up
the total "No" inputs in one column but count it up only if the other
column says yes. Any suggestions.

--
cubsfan
------------------------------------------------------------------------
cubsfan's Profile: http://www.excelforum.com/member.php...o&userid=33272
View this thread: http://www.excelforum.com/showthread...hreadid=534737


--

Dave Peterson


All times are GMT +1. The time now is 02:41 PM.

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