countif with and

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
sufianmalik said:
Anyone know how to count only if two items are satisfied?

Always exemplify what you need...

Taken up generally, one way:

=SUMPRODUCT(--(RangeX=CondX),--(RangeY=CondY))

would represent a multiconditional count with "=" as the relational test.
 
Upvote 0
Thanks

The example was:

Column A contains A, B, C , D

Column B, contains just Y and N

I want to count all the A's that are also Y's

How would i fit that in?
 
Upvote 0
Re: Thanks

sufianmalik said:
The example was:

Column A contains A, B, C , D

Column B, contains just Y and N

I want to count all the A's that are also Y's

How would i fit that in?

=SUMPRODUCT(--($A$2:$A$100="A"),--($B$2:$B$100="Y"))
 
Upvote 0
i'm curious to what the "--" is for in that formula =SUMPRODUCT(--($A$2:$A$100="A"),--($B$2:$B$100="Y"))
 
Upvote 0
Using the sum formula and entering as an array / CSE function would work as well. Enter the function and hold control+shift+enter.

http://www.cpearson.com/excel/array.htm

=SUM(($A$2:$A$100="A")*($B$2:$B$100="Y"))

The signifigance of the dashes is as they coerce the values from bool to numeric (T/F to 1/0).

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

I know the argument of the sumproduct is an array, but I think the array function is easier to look at and comprehend its intent. Different strokes. Both get you the same answer.

Jeromy
 
Upvote 0

Forum statistics

Threads
1,214,400
Messages
6,119,292
Members
448,885
Latest member
LokiSonic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top