Table of Contents
The HOUR function in Google Sheets is a useful tool for extracting the hour component from a given time value. It takes a time or date-time value as its input and returns the hour component as a number between 0 and 23. This function can be used in various scenarios, such as calculating working hours, tracking time spent on a task, or creating time-based charts and graphs. To use the HOUR function, simply enter the time value in the designated cell and use the function syntax “=HOUR(cell reference)” in the desired cell. This will automatically calculate and display the hour component of the given time value. The HOUR function is a quick and efficient way to manipulate time data in Google Sheets, making it a valuable tool for data analysis and organization.
HOUR
Returns the hour component of a specific time, in numeric format.
Sample Usage
HOUR(TIME(11,40,59))
HOUR(A2)
HOUR(40909.0004)
HOUR("20:49:59")
Syntax
HOUR(time)
time– The time from which to calculate the hour component. Must be a reference to a cell containing a date/time, a function returning a date/time type, or a number.
Notes
Ensure that the input to the function is either a reference to a cell containing a date/time, a function which returns a date/time object such as
TIME, or a date serial number of the type returned by theNfunction. Google Sheets represents dates and times as numbers; while conversion is automatic when a human-readable date is entered into a cell, functions only accept literal dates in numeric format.HOURdoes not autoconvert number formats in the same way that Google Sheets does upon direct entry into cells. Therefore,HOUR(12:00:00)will return an error.HOURreturns the intuitive understanding of hours, and is useful primarily in other calculations rather than to extract the hour component of a known time, as that value is easily known from a plain reading of the entire time.Note that date objects that are created with the
DATEfunction or by entry of a date without a time component will have a time of 0:00:00.
See Also
YEAR: Returns the year specified by a given date.
WEEKDAY: Returns a number representing the day of the week of the date provided.
TO_DATE: Converts a provided number to a date.
TIME: Converts an hour, minute, and second into a time.
SECOND: Returns the second component of a specific time, in numeric format.
N: Returns the argument provided as a number.
MONTH: Returns the month of the year a specific date falls in, in numeric format.
MINUTE: Returns the minute component of a specific time, in numeric format.
DAY: Returns the day of the month that a specific date falls on, in numeric format.
DATEVALUE: Converts a provided date string in a known format to a date value.
DATE: Converts a year, month, and day into a date.
Examples
Returns the hour as an integer for the given date value.
[wpcc-iframe height=”300″ src=”https://docs.google.com/spreadsheet/pub?key=0As3tAuweYU9QdFlYcEJhSDdIRlFqWVgtbWVvUlpLdFE&single=true&gid=0&output=html&widget=true” width=”500″]
Cite this article
stats writer (2024). How can I use the HOUR function in Google Sheets?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-hour-function-in-google-sheets/
stats writer. "How can I use the HOUR function in Google Sheets?." PSYCHOLOGICAL SCALES, 28 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-hour-function-in-google-sheets/.
stats writer. "How can I use the HOUR function in Google Sheets?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-hour-function-in-google-sheets/.
stats writer (2024) 'How can I use the HOUR function in Google Sheets?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-hour-function-in-google-sheets/.
[1] stats writer, "How can I use the HOUR function in Google Sheets?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I use the HOUR function in Google Sheets?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
