Countif of time intervals with multiple criteria

emisa042185

New Member
Joined
May 25, 2013
Messages
31
Hi there!

Hope some could help me. I have time stamps for several student in a class who will go for break lunch and coaching. I want to know what is the exact formula to use to count the number of occurance of either lunch break or coaching in an hourly interval basing from the timestamp.

i used countifs with predefined name for logged time, subject and actvity

formula used: =countifs(logged_time,">="&a1,logged_time,"<"&a2,Subject,"="&$A$5",Activity,"="&$A$6))

where: logged_time, Subject, Activity are pre-defined names which have the same range size
a1 is where the start time is (eg 7:00 AM)
a2 is where the end time is (eg 8:00 AM)
so basically i am looking for a formula to count the number of either break, lunch or coaching, in an hourly interval per subject.
a5, and a6 is where the reference of the subject (eg,, math or science)

many thanks

Ed
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Pretty much the formula that you had:


Excel 2010
ABCDEFG
107:002
217:00
3Logged_TimeSubjectActivity
402:00EnglishLunch
5French03:00FrenchLunch
6coaching04:00GermanLunch
705:00ITcoaching
806:00ITcoaching
907:00GermanLunch
1008:00Frenchcoaching
1109:00Englishcoaching
1210:00EnglishLunch
1311:00PhysicsLunch
1412:00PhysicsLunch
1513:00EnglishLunch
1614:00ITcoaching
1715:00Frenchcoaching
1816:00EnglishLunch
1917:00FrenchLunch
Sheet4
Cell Formulas
RangeFormula
C1=COUNTIFS(logged_time,">="&A1,logged_time,"<"&A2,Subject,"="&$A$5,Activity,"="&$A$6)
Named Ranges
NameRefers ToCells
Activity=Sheet4!$G$4:$G$19
logged_time=Sheet4!$C$4:$C$19
Subject=Sheet4!$E$4:$E$19
 
Upvote 0
Hi Sijpie,

thanks for your response. This is the formula i am using right now, and it did working fine but some of the time from the time column were not being read. I can upload the file that Im having confusion if you want to, so you may be able to find out as well what the problem I am saying.

Appreciate your help. Thanks
 
Upvote 0
Hi Sijpie,

this is the table im working into.

Time Stamp
SubjectActivityBreakLunchCoaching
7:00 PMMathLunch
7:01 PMScienceBeak
7:59 PMEnglishCoaching
8:00 PMMathCoaching
8:01 PMMathCoaching
8:30 PMMathCoaching
9:00 PMMathCoaching
9:01 PMMathCoaching
10:01 PMScienceCoaching
11:00 PMScienceCoaching
11:59 PMScienceLunch
12:58 AMScienceLunch
1:57 AMScienceLunch
2:56 AMEnglishLunch
3:55 AMEnglishLunch
4:54 AMEnglishLunch
5:53 AMEnglishLunch
6:52 AMEnglishLunch
7:51 AMEnglishLunch
8:50 AMEnglishBeak
9:49 AM
ScienceBeak
10:48 AMScienceBeak
11:47 AMScienceBeak
12:46 PMEnglishBeak
1:45 PMEnglishBeak
2:44 PMEnglishBeak
3:43 PMEnglishLunch
4:42 PMEnglishLunch
5:41 PMMathLunch
6:40 PMMathBeak
7:39 PMMathBeak

<colgroup><col><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0
For which times does it not work? Just some quick tests with me seem to be OK
 
Upvote 0
everything seems to be fine now, it was just a some formatting on the time stamp though. thanks for your help sijpie. :)
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,047
Members
449,206
Latest member
Healthydogs

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