Count Value between Dates and Time

In this post, you are going to know how to count occurrences between values (date or numbers).

Before that have some basic knowledge of count based on condition.

Query: We have Order time and Total time. Our task is to find the count of the date based on the given criteria.

Download Your Example Excel File

Formula to implement:


Count based on Start and End dates.
Count based on Start and End dates.

Function applicable

COUNTIFS: The Excel COUNTIFS function returns a count of numbers based on one or multiple given criteria.

Formula Used


=COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2]…)

Step 1: COUNTIFS(B3:B24,”>=”&$F$7,B3:B24,”<=”&$F$8)

Result: 21

It will first check the given criteria i.e. dates which are greater than or equals to “01-01-2017  10:23:00” (F7) and less than or equals to “07-01-2017  12:14:00” (F8) then give a count of the selected range (B3:B24).

Remember:  &” operator in Excel is a type of Concatenate which is used to join two strings, values, or results.

Note: COUNTIFS formula is a combination of COUNT and IFS formula.