Countifs on 3 conditions

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
610
Office Version
  1. 365
Platform
  1. Windows
Hello,
I've been using the formula

=IF(SUMPRODUCT(--($A$2:$A$2000>A2-15),--($A$2:$A$2000<A2+15),--($S$2:$S$2000=S2))>3,"Y","N")

and want to switch using Countifs to speed up the calculation.

I tried

=IF(COUNTIFS($A$2:$A$2000,">a2-15”,$A$2:$A$2000,"<A2+15”,$S$2:$S$2000,S2)>3,"Y","N")

but it didn't give me the correct results.


Any ideas why?

Thank you
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try putting spaces before and after your < and > because I believe the board is cutting off some of your formula due to the way it renders those and thinks they are html code.
 
Upvote 0
How strange.
This was my original post

Change Sumproduct
IF(SUMPRODUCT(--($A$2:$A$2000 > A2-15),--($A$2:$A$2000 < A2+15),--($S$2:$S$2000=S2)) > 3,"Y","N")

to

Countifs

IF(COUNTIFS($A$2:$A$5," > a2-15”,$A$2:$A$5," < A2+15”,$S$2:$S$5,S2) > 3,"Y","N")




This seems to work.


IF(COUNTIFS($A$2:$A$2000,">"&A2-15,$A$2000:$A$5,"<"&A2+15,$S$2000:$S$5,"="&S2)>3,"Y","N")
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,310
Members
452,906
Latest member
phanmemchatdakenhupviral

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