Nested Countif

gldurand

Board Regular
Joined
Jun 8, 2006
Messages
178
Office Version
  1. 2016
Platform
  1. Windows
Hi Team, I am trying to write a statement that would allow me to count the number of occurrences of the following information.

I need to count if Field A (text) = Yes, Field B (Text) = Yes and field C (Date) is between two specific dates.

I tried the following but does not work, i checked the result manually with filters and it does not match the formula result;

=SUMPRODUCT(--('Source Data'!$B$1:$B$544="Toronto"),--('Source Data'!$J$1:$J$544="Yes"),--('Source Data'!$F$1:$F$544<=2/3/2009))

Range B = TEXT
Range J = Text
Range F = Date

It is probably very easy, but my brain is fried.
Thanks
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You don't have a starting date in your formula so I picked 1/1/2009:

=SUMPRODUCT(--('Source Data'!$B$1:$B$544="Toronto"),--('Source Data'!$J$1:$J$544="Yes"),--('Source Data'!$F$1:$F$544>="1/1/2009"+0),--('Source Data'!$F$1:$F$544<="2/3/2009"+0))

This way it will coerce the text string to a date, the way you have it Excel will interpret that as 2 divided by 3 divided by 2009
 
Last edited:
Upvote 0
Hotpepper, thanks so much, it works, foolish me, should have come here after 1 hour of trying, My ego got to me

Thanks again
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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