Countifs problem with dates

Mark_E

New Member
Joined
Aug 11, 2016
Messages
14
I am trying to get a count of dates in column I that are equal to or less than the date in column J for each worker whose name is in a rotating series in column C.

SO far, I have
Code:
=COUNTIFS('April 2016 CARL Assigned'!$C:$C,"'April 2016 CARL Assigned'!$C2",'April 2016 CARL Assigned'!$J:$J,"<='April 2016 CARL Assigned'!$I:$I")

But this does not work.

Breaking it down,
Code:
=COUNTIFS('April 2016 CARL Assigned'!$B:$B,"'April 2016 CARL Assigned'!$B2")
return the correct value, so it is the comparison of I:I to J:J that the problem.

The data looks like this, but in a 2500 row table:

<colgroup><col><col></colgroup><tbody>
</tbody>
JI
8/1/168/1/16
7/20/167/18/16
8/7/168/8/16
8/5/168/9/16
8/6/168/4/16
7/27/167/27/16
8/5/168/1/16
8/5/168/4/16

<tbody>
</tbody>

Any help is much appreciated.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Countifs won't be alble to do that..

Try
=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C:$C='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J:$J<='April 2016 CARL Assigned'!$I:$I))


However, I HIGHLY recommend NOT using entire column references like C:C in this formula.
Restrict it to your actual used area, like

=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C$1:$C$1000='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J$1:$J$1000<='April 2016 CARL Assigned'!$I$1:$I$1000))
 
Upvote 0
Countifs won't be able to do that..

=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C$1:$C$1000='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J$1:$J$1000<='April 2016 CARL Assigned'!$I$1:$I$1000))

This produces the same result as:

=COUNTIFS('April 2016 CARL Assigned'!$C:$C,'April 2016 CARL Assigned'!$C2)

It delivers a count of the number of occurrences of the worker's name, but it is not giving me a count of the number of dates in J that are less than or equal to the date in I.
 
Upvote 0
This produces the same result as:

=COUNTIFS('April 2016 CARL Assigned'!$C:$C,'April 2016 CARL Assigned'!$C2)
If it is, it's purely coincidental, not logically correct.

This is only counting rows where column C are equal to C2
=COUNTIFS('April 2016 CARL Assigned'!$C:$C,'April 2016 CARL Assigned'!$C2)


This is counting rows where column C are equal to C2 AND the value in column J is less than or equal to the value in column I
=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C:$C='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J:$J<='April 2016 CARL Assigned'!$I:$I))
 
Last edited:
Upvote 0
If it is, it's purely coincidental, not logically correct.

This is counting rows where column C are equal to C2 AND the value in column J is less than or equal to the value in column I
=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C:$C='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J:$J<='April 2016 CARL Assigned'!$I:$I))

It must be counting blank cells in I & J as being equal. Is there a way to do a SUMPRODUCT that ignores blanks?
 
Upvote 0
Try
=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C:$C='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J:$J<='April 2016 CARL Assigned'!$I:$I),--('April 2016 CARL Assigned'!$J:$J<>""))


Again, I HIGHLY recommend NOT using entire column references like $C:$C in this formula.
Restrict it to your actual used area, like $C$1:$C$1000
 
Upvote 0
Try
=SUMPRRODUCT(--('April 2016 CARL Assigned'!$C:$C='April 2016 CARL Assigned'!$C2),--('April 2016 CARL Assigned'!$J:$J<='April 2016 CARL Assigned'!$I:$I),--('April 2016 CARL Assigned'!$J:$J<>""))


Again, I HIGHLY recommend NOT using entire column references like $C:$C in this formula.
Restrict it to your actual used area, like $C$1:$C$1000

That worked great, I had already made the changes to the range, but copied the old formula :/

Thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,215,374
Messages
6,124,573
Members
449,173
Latest member
Kon123

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