Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to Use Solver Tool in Excel
  • How to calculate current stock or inventory in Excel
  • How to Sort by Color in Excel
  • How To Insert and Customize Sparklines in Excel
  • Excel Pie Chart

References

  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • Multi-criteria lookup and transpose in Excel
  • Two-way lookup with VLOOKUP in Excel
  • Excel Advanced Lookup using Index and Match Functions
  • How to use Excel MMULT Function

Data Validations

  • Excel Data validation exists in list
  • Excel Data validation must contain specific text
  • Excel Data validation allow weekday only
  • Excel Data validation date in next 30 days
  • Prevent invalid data entering in specific cells

Count times in a specific range in Excel

by

This tutorial shows how to Count times in a specific range in Excel using example below.

To count times that occur within a certain range, you can use the COUNTIFs function.

Formula

=COUNTIFS(range,">="&start,range,"<"&end)

Explanation

In the example shown, the formula in E7 is:

=COUNTIFS(B5:B11,">="&E5,B5:B11,"<"&E6)

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:

B5:B11,">="&E5

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

Worked Example:   Excel Date & Time Functions Example

The second range/criteria pair is:

B5:B11,"<"&E6

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

Worked Example:   Summary count of non-blank categories in Excel

With hard-coded values

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

=COUNTIFS(B5:B11,">=5:00",B5:B11,"<6:30")

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

Worked Example:   Two ways to sum time over 30 minutes in Excel

With the TIME function

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

=COUNTIFS(B5:B11,">="&TIME(5,0,0),B5:B11,"<"&TIME(6,30,0))

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

Post navigation

Previous Post:

Count holidays between two dates in Excel

Next Post:

Create date range from two dates in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IFERROR function: Description, Usage, Syntax, Examples and Explanation
  • How to use IFS function in Excel
  • IF with wildcards in Excel
  • How to use Excel OR Function
  • Nested IF function example in Excel

Date Time

  • Extract date from a date and time in Excel
  • Get first Monday before any date in Excel
  • Get days, hours, and minutes between dates in Excel
  • EDATE function: Description, Usage, Syntax, Examples and Explanation
  • Count day of week between dates in Excel

Grouping

  • How to randomly assign data to groups in Excel
  • Group times into 3 hour buckets in Excel
  • Categorize text with keywords in Excel
  • How to randomly assign people to groups in Excel
  • Map inputs to arbitrary values in Excel

General

  • Index and match on multiple columns in Excel
  • Subtotal by invoice number in Excel
  • Count cells less than in Excel
  • How to calculate percentage discount in Excel
  • Using Existing Templates in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning