Home » excel » excel – Countif does not work with hours and/ or dates

excel – Countif does not work with hours and/ or dates

Posted by: admin April 23, 2020 Leave a comment

Questions:

Hi I have data inside 3 columns:

A. Destination (es. LosAngeles)
B. Carrier (es. Ups)
C. Shipment Time (es. 4:00)

The time used is the 24h time without Am/Pm

I need to do a countif to know how many shipments we have at a specific time.

Tried with:
=COUNTIF(A1:A100,”>=”&TIME(8,30,0))-COUNTIF(A1:A100,”>”&TIME(9,0,0)
Result 0

Tried with:
=COUNTIFS(A1:A100,”>=8:30″,A1:A100,”<=9:00″)
Result 0

Tried with:
=COUNTIF(‘sheet1’!I:I,”<=”&TIME(4, 0, 0))
Result 0

Any help?
Thank you in advance.

How to&Answers:

Try:

=COUNTIFS(A1:A100,">="&TIME(8,30,0),A1:A100,"<="&TIME(9,0,0))

The formula below was missing a closing bracket at the end

=COUNTIF(A1:A100,">="&TIME(8,30,0))-COUNTIF(A1:A100,">"&TIME(9,0,0))