Quick, clean, and to the point

Count times in a specific range

Excel formula: Count times in a specific range
Generic formula 

To count times that occur within a certain range, you can use the COUNTIFs function. In the example shown, the formula in E7 is:


How this formula works

The COUNTIFS function takes one or more criteria, entered as range/criteria pairs. In this example, the first range/criteria pair is:


Matching any time greater than or equal to the time E5 (5:00).

The second range/criteria pair is:


Matching any time less than the time in E6 (6:30).

With hard-coded values

The formula in E7 could be written with hard-coded time values as follows:


Excel translates a string like "5:00" into the correct numeric time value.

With the TIME function

The formula in E7 could be written with the TIME function like this:


The TIME function provides a simple way to assemble a valid time using discreet hour, minute, and second values.

Dave Bruns

Excel Formula Training

Formulas are the key to getting work done in Excel. In this step-by-step training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Start building valuable skills with Excel formulas today. Learn more.

I have relied on your website on countless occasions throughout the course of my graduate level finance internship. Compared to a number of unnamed Excel tutorial sites and forums, yours is par-none. It is invariably the only source for consistently accurate and understandable formula functions and syntaxes. I say that as this page has solved an hours-long problem facing me during an all-night work session. Thanks a lot! - Nick
Excel foundational video course
Excel Pivot Table video training course
Excel formulas and functions video training course
Excel Shortcuts Video Course
Excel Charts video training course