I am trying to format an integer column to a time column, but the values all end up as 12 like this:
12
12
12
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI am trying to format an integer column to a time column, but the values all end up as 12 like this:
12
12
12
If you don't want to deal with division and other math to get to the decimal time value, you can use the TIME
function which will handle it all for you:
Usage for your example
MS reference: https://support.office.com/en-nz/article/TIME-function-9a5aff99-8f7d-4611-845e-747d0b8d5457
In Excel, dates are stored with integers for day numbers (since 1900) and times as fractions of a day.
If your integers represent the hour of the day, divide them by 24, then format as time.
In Excel, times are stored as the fraction of a day. Therefore, each hour is 1/24 of a day. To convert integer hours to a time, divide the time by 24 and format as a date and/or time.
More info:
Excel stores dates as sequential serial numbers so that they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900.
Numbers to the right of the decimal point in the serial number represent the time; numbers to the left represent the date. For example, the serial number 0.5 represents the time 12:00 noon.
https://support.office.com/en-us/article/NOW-function-3337fd29-145a-4347-b2e6-20c904739c46