COUNTIFS function with Criteria as a Cell Reference Range

rohanp16

New Member
Joined
Jan 10, 2017
Messages
2
I'm trying to use a COUNTIFS function for multiple conditions, one of which is to not count values within a certain cell range (C2:C11) when those values are lesser than those in the adjacent column (i.e., D2:D11), however this doesn't seem to be working.

51.0431.2
81.21.0235
31.0231.2
211.21.2
170.99091.2
61.20.9915
101.21.0255
121.20.9075
141.20.9505
180.97700.9694

<tbody>
</tbody>

The whole formula I'm using (with the other conditions initially, that work fine) is as follows,

=COUNTIFS(B2:B11,">=16",B2:B11,"<=20",C2:C11,"<1.2",C2:C11,"<"&D2:D11)

which returns the value of 2 but the correct answer is 1 (last row should be excluded).

Any idea what I'm doing incorrectly ? Thank you for looking !
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
try this subproduct() alternative

=SUMPRODUCT((B2:B11 >= 16)*(B2:B11 <= 20)*(C2:C11 < 1.2)*(C2:C11 < D2:D11))
 
Last edited:
Upvote 0
Try like this:

=SUMPRODUCT(--(B2:B11>=16),--(B2:B11<=20),--(C2:C11 < 1.2),--(C2:C11 < D2:D11))<d2:d11))< html=""></d2:d11))<>
 
Last edited:
Upvote 0
i believe excel's countifs() function cannot deal with an array as criteria such as "<"&D2:D11 in your formula.
 
Upvote 0
Thank you AlanY and Aladin, that worked like a charm !

Following on, I tried to average those values with similar criteria but it seems that AVERAGEIFS also cannot handle the "<D2:D11" either. However, I used SUMPRODUCT to calculate the average (i.e., SUM/COUNT) and it works correctly.

For anyone else reading, a handy website for the SUMPRODUCT function,

https://www.ablebits.com/office-addins-blog/2016/08/24/excel-sumproduct-function-formula-examples/

Cheers for the prompt help both of you !
 
Upvote 0
Thank you AlanY and Aladin, that worked like a charm !

Following on, I tried to average those values with similar criteria but it seems that AVERAGEIFS also cannot handle the "<d2:d11" i="" correctly.

For anyone else reading, a handy website for the SUMPRODUCT function,

https://www.ablebits.com/office-addins-blog/2016/08/24/excel-sumproduct-function-formula-examples/

Cheers for the prompt help both of you !

It's by design the case that the range-processing functions like COUNTIF(S), SUMIF(S), and AVERAGE(S) do not process array-evaluations like C2:C11 < D2:D11 >> {TRUE;TRUE;FALSE;...}.

By the way, this site contains zillions of SUMPRODUCT applications, including a first write up: http://www.mrexcel.com/forum/hall-f...s-explanation-condition-driven-computing.html

</d2:d11">
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,479
Members
448,967
Latest member
visheshkotha

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