COUNTIF modification to look take into consideration a second criteria

RodneyC

Active Member
Joined
Nov 4, 2021
Messages
278
Office Version
  1. 2016
Platform
  1. Windows
Shout out to Joe4 who helped me get this far.

I'm using this formula to produce a result of either Y or N based on the value in InclusionList!$A$2:$A$32

=IF(COUNTIF(InclusionList!$A$2:$A$32,B4)>0,"Y","N")

In reality, I have values in $A$2:$A$1000 but am only looking at $A$2:$A$32 because those have a specific date associated with them that is in column B on the InclusionList tab. For example, lets say that date in B2:B32 is 9/8/2022. B33:B65 may have 9/11/2022 and so on until we reach the end of the measured period of time. I need to modify the formula above so that it looks in cell D2 and only produces a Y if the conditions in the original formula are met AND InclusionList!$B:$1000 equals the value in D2.

Thanks on advance
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try this -

Excel Formula:
=IF(COUNTIFS(InclusionList!$A$2:$A$1000,B4,InclusionList!$B:$1000,$D$2)>0,"Y","N")
 
Upvote 0
Try this -

Excel Formula:
=IF(COUNTIFS(InclusionList!$A$2:$A$1000,B4,InclusionList!$B:$1000,$D$2)>0,"Y","N")
Excel said there was a typo and changed the formula to this: =IF(COUNTIFS(InclusionList!$A$2:$A$1000,B4,InclusionList!$B$1000,$D$2)>0,"Y","N") which produces a #VALUE result
 
Upvote 0
Excel said there was a typo and changed the formula to this: =IF(COUNTIFS(InclusionList!$A$2:$A$1000,B4,InclusionList!$B$1000,$D$2)>0,"Y","N") which produces a #VALUE result
There is an error in the formula I gave and system corrected.

Try this and update -

Excel Formula:
=IF(COUNTIFS(InclusionList!$A$2:$A$1000,B4,InclusionList!$B$2:$B$1000,$D$2)>0,"Y","N")

Also, note that I have populated formula assuming the date to look up is in cell D2 thus making cell D2 absolute reference.
 
Upvote 0
Solution
There is an error in the formula I gave and system corrected.

Try this and update -

Excel Formula:
=IF(COUNTIFS(InclusionList!$A$2:$A$1000,B4,InclusionList!$B$2:$B$1000,$D$2)>0,"Y","N")

Also, note that I have populated formula assuming the date to look up is in cell D2 thus making cell D2 absolute reference.
That worked, thank you. and yes, $D$2 is a constant
 
Upvote 0

Forum statistics

Threads
1,215,669
Messages
6,126,125
Members
449,293
Latest member
yallaire64

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