PDA

View Full Version : CountIF statement



nepotist
07-30-2009, 07:49 AM
Hello guys,

I have a database that stores information like at what time a person has entered the building.
for example:
Columns: Time Access Yes/No?
11:57:26 PM Yes
12:00:00 AM No
11:02:00 PM Yes
what I am trying to do is that try to find out number of people that entered in to the building between a interval of time.

that data that I got had date along with the time , so I created a new column "Time" which has a formula =text(date/time,"HH:MM:SS")

I am using count if statement to get my task done.
My task is to find the count between each 15 minute interval.
The problem is that it isn't working write or you could say I am missing some thing. I am not trying to write a code here, it is just a formula that I am trying to use.

Please find the attached spreadsheet. and help me out.

Thankyou.

Krishna Kumar
07-30-2009, 08:32 AM
In N2 and copied down,

=SUMPRODUCT(--(MOD($A$2:$A$67,1)>=I2),--(MOD($A$2:$A$67,1)<=J2))

HTH

nepotist
07-30-2009, 08:40 AM
I am not sure if you tried it, but that dosent work .
I appreciate you trying to help me, Could please have a look at it again.

Krishna Kumar
07-30-2009, 08:42 AM
How do you say it doesn't work? What's the results you get?

mdmackillop
07-30-2009, 08:42 AM
Try this

nepotist
07-30-2009, 08:44 AM
My apologise.. It works.. could you please explain it though

Krishna Kumar
07-30-2009, 08:53 AM
Hi,

This Article (http://vbaexpress.com/forum/showthread.php?t=26676) might help you.