# How to convert integer column to time column?

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
``````

• Dates are stored with integers for day numbers and times as fractions of a day. If the integers represent the hour of the day, divide by 24, then format as time. – AFH Jun 29 '15 at 13:47
• Wow that works. Care to post it as a reply, so I can accept? :) – giorgio79 Jun 29 '15 at 13:52

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:

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.

• I really like this idea. Meanwhile, someone posted the TIME function, which I also love and find quite powerful. – giorgio79 Jun 29 '15 at 20:00
• Yes, I didn't think of the `TIME` function, and I agree it's a better answer. – AFH Jun 29 '15 at 20:38

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.