# 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.

Formula to implement:

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

Function applicable

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

Formula Used

Syntax:

=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.