Sorry for the delay in replying, RL called
M2=COUNTIFS($A:$A,">="&$L2,$A:$A,"<"&$L2+1,$D:$D,M$1)
This is the same as the basic COUNTIF() function, however, COUNTIFS() allows for more than 1 criteria to be tested. So in that example...
=COUNTIFS(A:A...this means look in the range that has the dates...which is column A
,">="&$L2,....this means to look for any dates >= the date in L2
then again in range $A:$A....the range with the dates
,"<"&$L2+1,...look for any dates that are less than < the date in L2 + 1
I used L2 + 1 because you also have times in column A, so I could not just use =L2, because even just 1 minute into the day means that date does not = just "the date"
and finally...
$D:$D...this is teh range with the codes in it
,M$1) this if the heading of thet column, which adjusts as you copy it across
The 2nd formula is pretty much the same thing....
M3=COUNTIFS($A:$A,">="&$L2,$A:$A,"<="&$L3+1,$D:$D,M$1)
only different, I am using a 2nd reference for the 2nd date
Hope that helps?
Bookmarks