C
C
Cguru2014-08-23 17:01:05
Google Sheets
Cguru, 2014-08-23 17:01:05

How to count the number of rows for a certain hour in Google Drive tables?

Tell me how to correctly calculate the number of records for a certain hour in google drive tables.
Suppose there is a column with data in the "date and time" format.
What formula should be used to find out the number of records for the interval 00:00:00 -> 00:59:59.
Data example.

22.08.2014 00:05:26
22.08.2014 00:07:50
22.08.2014 00:10:20
22.08.2014 2:19:53
22.08.2014 2:27:49
22.08.2014 2:52:37
22.08.2014 2:54:54
22.08.2014 3:54:03
22.08.2014 3:54:07
22.08.2014 3:56:53

Based on the data from the example, you need to get the result '3'.
There is a decision:
Using QUERY request.
Then you can make a selection in this way.
=QUERY( A:A; "select A where hour (A) = 0" )
The result will be a list of strings in the range 00:00:00 -> 00:59:59 :
22.08.2014 00:05:26
22.08.2014 00:07:50
22.08.2014 00:10:20

If you only need to calculate the number, as in my task, then we additionally use the COUNT () function:
=COUNT(QUERY( A:A; "select A where hour (A) = 0" ))

The result will be 3 .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EndUser, 2014-08-24
@EndUser

=countif(***********)

A
Alexander Ivanov, 2014-11-05
@oshliaer

Not as beautiful as Cguru , but ...
You can output the result immediately in the query
=QUERY(A:A;"select count(A) where hour(A) = 0")
. In this case, two lines will appear in the output - the header of the aggregate function and the result

count
3

Transposed variant with given title "Amount"
=TRANSPOSE(QUERY(A:A;"select count(A) where hour(A) = 0 label count(A) 'Количество'"))

Quantity3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question