Countif for multiple criteria given two dynamic ranges match

grexcelman

Board Regular
Joined
Mar 1, 2015
Messages
50
I'm trying to count the instances value are less than zero given two dynamic column ranges match. That's a mouthful. These are named ranges 'universe' and 'planets'. I have the following formula to give me the total number of instances that I have a match however I'm not sure where to include the additional criteria to return how many of these matches have corresponding data values less than 0 in the adjacent column C.

Code:
  {=COUNT(IF(ISNUMBER(MATCH(universe,planets,0)),$C$7:$C$35))}

Thanks in advance!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I have never seen this use of match - I assume you have tried c7:c35 <0

or wrap it in a sumproduct where c7:c35=0 I will have a play with this in about an hour if nobody has sorted it....
 
Upvote 0
{=COUNT(IF(ISNUMBER(MATCH(universe,planets,0)),IF($C$7:$C$35 < 0, $C$7:$C$35)))}

Or...

{=SUM(IF(ISNUMBER(MATCH(universe,planets,0)),IF($C$7:$C$35 < 0, 1)))}
 
Upvote 0
123
234
345
446
567
678
770####
89102
91011
101112=SUMPRODUCT(($A$1:$A$20=$B$1:$B$20)*($C$1:$C$20=0))
111113
121314even better
1314152
141516
15150####=SUMPRODUCT((range1=range2)*(range3=0))
161718
171819
181920
192021
202122the 3 columns are of course range1, range2 and range3

<colgroup><col width="64" span="13" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
getting a bunch of #N/A results with the sumproduct and combining '*' method. Will need to review how to incorporate but I think the dynamic ranges might be throwing this off. Thanks again.
 
Upvote 0
Both worked nicely! thanks very much.

You are welcome.

getting a bunch of #N/A results with the sumproduct and combining '*' method. Will need to review how to incorporate but I think the dynamic ranges might be throwing this off. Thanks again.

If you insist on SumProduct...

=SUMPRODUCT(--ISNUMBER(MATCH(universe,planets,0)),--($C$7:$C$35 < 0))

where the size of universe and the size of C7:C35 (number of cells of both range) must be equal. This requirement holds also for SUM+IF and COUNT+IF versions equally.
 
Upvote 0
122
231
340
44-1<
56-2
672
7713
890=SUMPRODUCT((a=b)*(d<1))
910-1
1010-2<
11122
12131
13140
1414-1<the #'s represent blanks
###to show how a dynamic range can be accomodated
###
###
###a, b and d are the 3 columns
###
###

<colgroup><col><col><col><col span="7"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,867
Members
449,053
Latest member
Mesh

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