Excel: convert time to decimal number, hours, minutes or seconds (2024)

The tutorial demonstrates different ways to convert time to decimal in Excel. You will find a variety of formulas to change time to hours, minutes or seconds as well as convert text to time and vice versa.

Because Microsoft Excel uses a numeric system to store times, you can easily turn hours, minutes and seconds into numbers that you can use in other calculations.

In general, there are two ways to convert time to decimal in Excel - by changing the cell format and by using arithmetic calculations or Excel time functions, such as HOUR, MINUTE and SECOND. Further on in this tutorial, you will find the detailed explanation of the first way and formula examples demonstrating the other technique.

How to convert time to decimal number in Excel

Overall, there are three ways to change a time value to a decimal number: arithmetic operation, CONVERT function or a combination of three different Time functions.

The easiest way to convert time to decimal in Excel is to multiply the original time value by the number of hours, seconds or minutes in a day:

  • To convert time to a number of hours, multiply the time by 24, which is the number of hours in a day.
  • To convert time to minutes, multiply the time by 1440, which is the number of minutes in a day (24*60).
  • To convert time to seconds, multiply the time time by 86400, which is the number of seconds in a day (24*60*60 ).

Excel: convert time to decimal number, hours, minutes or seconds (1)

In the following sections, you will learn the other methods of converting times to a decimal number in Excel.

How to convert time to hours in Excel

This section demonstrates 3 different formulas to convert hours from the standard time format (hh:mm:ss) to a decimal number.

Formula 1: Arithmetic calculation

You already know the fastest way to convert a time value to a number of hours in Excel - multiplying by 24, i.e. by the number of hours in one day:

=A2*24

Where A2 is the time value.

To get the number of compete hours, embed the above formula in the INT function that will get rid of the fractional part:

=INT(A2*24)
Excel: convert time to decimal number, hours, minutes or seconds (2)

Formula 2: CONVERT function

Another way to perform the "time > hours" conversion is to use the following Convert formula:

=CONVERT(A2, "day", "hr")

Formula 3: HOUR, MINUTE and SECOND functions

Finally, you can use a bit more complex formula, whose logic, however, is quite obvious. Extract the individual time units by using the HOUR, MINUTE and SECOND functions, then divide minutes by 60 (the number of minutes in an hour) and seconds by 3600 (the number of seconds in an hour), and add up the results:

=HOUR(A2) + MINUTE(A2)/60 + SECOND(A2)/3600

How to convert time to minutes in Excel

The same three methods can be used to convert minutes from the standard time format to a decimal number.

Formula 1: Arithmetic calculation

To convert time to total minutes, you multiply time by 1440, which is the number of minutes in one day (24 hours * 60 minutes = 1440):

=A2*1440

If you want to return the number of compete minutes, utilize the INT function like in the previous example:

=INT(A2*1440)

You can view the results in the screenshot below:
Excel: convert time to decimal number, hours, minutes or seconds (3)

Formula 2: CONVERT function

To do the "time > minutes" conversion with the CONVERT(number, from_unit, to_unit) function, supply "day" as the unit to convert from and "mn" as the unit to convert to:

=CONVERT(A2, "day", "mn")

Formula 3: HOUR, MINUTE and SECOND functions

One more way to get the number of minutes is to multiply hours by 60 and divide seconds by the same number:

=HOUR(A2)*60 + MINUTE(A2) + SECOND(A2)/60

How to convert time to seconds in Excel

Converting time to total seconds in Excel can be done in a similar fashion.

Formula 1: Arithmetic calculation

Multiply the time value by 86400, which is the number of seconds in a day (24 hours * 60 minutes * 60 seconds = 86400):

=A2*86400
Excel: convert time to decimal number, hours, minutes or seconds (4)

Formula 2: CONVERT function

The formula is basically the same as in the above examples with the only difference that you convert the "day" unit to "sec":

=CONVERT(A2, "day", "sec")

Formula 3: HOUR, MINUTE and SECOND functions

Use the HOUR, MINUTE and SECOND functions like in the two previous examples (I believe at this point you don't need any further explanation of the formula's logic :)

=HOUR(A2)*3600 + MINUTE(A2)*60 + SECOND(A2)

Tips:

  1. If any of the above formulas returns a value formatted as time, simply change the cell's format to Generalto display it as a number.
  2. To convert time to a decimal number that represents the time in the internal Excel system, apply the General format to the cell. With this approach, 23:59:59 will be converted to 0.99999, 06:00 AM to 0.25, and 12:00 PM to 0.5. If an integer part of the converted number is greater than zero, it means that your cell contains both date and time values.

How to split date and time in Excel

As is often the case, your Excel worksheet may contain dates and times in one cell, while you want to split them into two separate cells.

Remembering that in the internal Excel system the date value is stored as a whole part and the time value as a fractional part of a decimal number, you can extract the date using the INT function, which rounds the cell value down to the nearest integer.

Supposing your original dates and times are in column A, the following formula will accomplish the separation:

=INT(A2)
Excel: convert time to decimal number, hours, minutes or seconds (5)

To extract the time portion, subtract the date returned by the above formula from the original date and time value:

=A2-B2

Where column A contains the original date & time values and column B contains the dates returned by the INT function.

If you'd rather not have time values linked to the separated dates (for example, you may want to remove the date column in the future), you can use the following MOD formula that refers to the original data only:

=MOD(A2,1)
Excel: convert time to decimal number, hours, minutes or seconds (6)

Tip. If the separated date and time values are not displayed properly, change the format of the new columns to Date and Time, respectively.

This is how you split date and time in Excel. If you want to further separate hours, minutes and seconds into individual columns, then use the HOUR, MINUTE and SECOND functions, as demonstrated in How to get hours, minutes and seconds from a timestamp.

How to spell time in Excel

Sometimes, you may need to convert time into the format that reads something like "# days, # hours, # minutes and # seconds". A good thing is that you already know all the ingredients of the formula:

  • Extract days using the INT function;
  • Extract time units with HOUR, MINUTE and SECOND functions, and
  • Concatenate all parts in a single formula.

Having difficulties with figuring out a proper formula for your worksheet? The following example will make things easy!

Supposing you have the dates of upcoming events in column B beginning in cell B4, and the current date and time returned by the NOW() function in cell B1.

The formula to calculate the time difference is as simple as =B4-$B$1. Of course, nothing prevents you from subtracting the current date and time directly with =B4-NOW().

And now, let's make a countdown timer that would show how many days, hours, minutes and seconds are left until each event.
Excel: convert time to decimal number, hours, minutes or seconds (7)

The formula to enter in cell D4 is as follows:

=INT(C4) & " days, " & HOUR(C4) & " hours, " & MINUTE(C4) & " minutes and " & SECOND(C4) & " seconds"
Excel: convert time to decimal number, hours, minutes or seconds (8)

If you wish to get rid of 0 values, like in cells D6 and D7 in the screenshot above, then include the following IF statements:

=IF(INT(C4)>0, INT(C4)&" days, ","") & IF(HOUR(C4)>0, HOUR(C4) & " hours, ","") & IF(MINUTE(C4)>0, MINUTE(C4) & " minutes and ","") & IF(SECOND(C4)>0, SECOND(C4) & " seconds","")

All zeros are gone!
Excel: convert time to decimal number, hours, minutes or seconds (9)

Note. When either of the above formulas refers to a negative number, the #NUM! error will appear. This may happen when you subtract a bigger time from a smaller one.

An alternative way to write time in words in Excel is to apply the following custom time format to the cell: d "day," h "hours," m "minutes and" s "seconds". No formulas and no calculations are required! For more information, please see Creating a custom time format in Excel.

Convert text to time in Excel

If your time formulas and calculations do not work right, time values formatted as text is often the cause. The fastest way to convert text to time in Excel is using the TIMEVALUE function.

The Excel TIMEVALUE function has just one argument:

TIMEVALUE(time_text)

Time_text is a text string in any of the time formats that Excel can recognize. For example:

=TIMEVALUE("6:20 PM")

=TIMEVALUE("6-Jan-2015 6:20 PM")

=TIMEVALUE(A2) where A2 contains a text string
Excel: convert time to decimal number, hours, minutes or seconds (10)

As you see, the formulas with cell references and corresponding text strings deliver identical results. Also, please notice the left alignment of time strings (text values) in cells A2 and A6 and right-aligned converted time values in column D.

Convert time to text in Excel

Supposing you have an Excel file full of times formatted to look like "8:30:00 AM" and you want to convert them to the text format. Simply changing the cell's format to TEXT won't work because this would change your time values to underlying numeric representation of the time. For example, 8:30:00 AM will be converted to decimal 0.354166666666667.

So, how do you convert cells to the text format so that your cells still have the time in them? The answer is to use the TEXT function that converts a numeric value to text with the display formatting that you specify, for example:

=TEXT($A2,"h:mm:ss")

The screenshot below demonstrates other possible formats:
Excel: convert time to decimal number, hours, minutes or seconds (11)

How to convert numbers to time format in Excel

If you have a list of numbers such as 1, 2, 3.5 and you want to convert them to a time format, for example 1:00:00, 2:00:00 or 3:30 AM, perform the following steps.

  1. Divide the numbers by 24 (there are 24 hours in a day). The formula can be as simple as =A2/24.
  2. Select the cell(s) with the formula result, right-click and select Format Cells from the context menu or press Ctrl+1. Either way, the Format Cells dialog will appear, you select Time on the left pane under Category, and choose the format you want on the right pane under Type. Please see How to format time in Excel for more details.

Excel: convert time to decimal number, hours, minutes or seconds (12)

If your time exceeds 24 hours, 60 minutes, 60 seconds, use these guidelines to correctly show it.

That's all for today. If someone wants to get the first-hand experience with the formulas discussed in this article, you are most welcome to download the sample workbook below.

If you want to learn a few more useful formulas to calculate times in Excel, please check out the related tutorials at the end of this page. I thank you for reading and hope to see you again next week!

Practice workbook for download

Converting time in Excel - examples (.xlsx file)

Excel Times tutorials

  • How to calculate time in Excel: time difference, add / subtract times
  • How to insert dates in Excel

I am an Excel expert with a comprehensive understanding of time-related functions and formatting in Microsoft Excel. I have hands-on experience with various formulas and techniques to manipulate and convert time values within spreadsheets. My expertise includes not only the theoretical knowledge but also practical applications in real-world scenarios.

In the provided article, the tutorial covers a range of topics related to converting time to decimal in Excel, including:

  1. Introduction:

    • Overview of converting time to decimal in Excel.
    • Mention of using numeric system storage in Excel for time.
  2. Methods of Converting Time to Decimal:

    • Cell format change.
    • Arithmetic calculations and Excel time functions (HOUR, MINUTE, SECOND).
  3. Specific Techniques:

    • Converting time to hours, minutes, and seconds.
    • Splitting date and time into separate columns.
  4. Formula Examples:

    • Demonstrations of three ways to convert time to a decimal number.
    • Multiplying by the number of hours, minutes, or seconds in a day.
  5. Converting Time to Hours, Minutes, and Seconds:

    • Formulas for each conversion with arithmetic operations, CONVERT function, and HOUR, MINUTE, SECOND functions.
  6. Splitting Date and Time:

    • Using the INT function to separate date and time.
    • Utilizing the MOD formula for independent time values.
  7. Spelling Time in Excel:

    • Creating a formula to display time in the format "# days, # hours, # minutes, and # seconds."
    • Handling negative values in the countdown timer.
  8. Convert Text to Time:

    • Using the TIMEVALUE function to convert text to time.
    • Examples of different time formats.
  9. Convert Time to Text:

    • Using the TEXT function to convert time values to text while maintaining the time format.
  10. Convert Numbers to Time Format:

    • Dividing numbers by 24 to convert them to time format.
    • Formatting the result using the Format Cells dialog.
  11. Conclusion:

    • Encouragement to download a practice workbook.
    • Reference to additional tutorials on calculating times in Excel.

As an enthusiast with in-depth knowledge, I encourage readers to explore the provided techniques for efficient time-related operations in Microsoft Excel. If there are any questions or if someone wants to delve into practical examples, the provided sample workbook is available for download.

Excel: convert time to decimal number, hours, minutes or seconds (2024)

FAQs

Excel: convert time to decimal number, hours, minutes or seconds? ›

Select data > Right click > Format cells > Number > Two > OK

How do you convert hours minutes and seconds to decimals in Excel? ›

If you or an employee used custom time formats in Excel, you can convert them to decimals simply by changing the format. Highlight the cells, right-click them and then select "Format Cells." Under the Number tab, select "Number."

How do you convert hours minutes and seconds to decimals? ›

Hours remain the same in decimal time as in standard time. Minutes are converted into a decimal by dividing by 60 (since there are 60 minutes in an hour). Seconds are converted into a decimal by dividing by 3600 (since there are 3600 seconds in an hour).

How do you convert time difference to hours in decimals in Excel? ›

Because an hour in Excel is 1/24, you can multiply time by 24 to get a decimal hour. For example 0.5 * 24 = 12 hours, 0.25 * 24 = 6 hours, etc.

How do you convert time duration to decimal? ›

To convert time into decimal format, you need to divide minutes by 60. The decimals are rounded, since decimal hours show only two decimal places. For example, 26 minutes divided by 60 equals 0.433333.

How to convert time in Excel to decimal? ›

The easiest way to convert time to decimal in Excel is to multiply the original time value by the number of hours, seconds or minutes in a day: To convert time to a number of hours, multiply the time by 24, which is the number of hours in a day.

How do you convert 2 hours and 45 minutes to a decimal hour? ›

To convert 2 hours and 45 minutes to decimal form, you can express the minutes as a fraction of an hour. Since there are 60 minutes in an hour, 45 minutes is 45/60 of an hour, which simplifies to 3/4 of an hour. So, 2 hours and 45 minutes is equivalent to 2.75 hours when expressed in decimal form.

How do you turn 2 hours and 30 minutes into decimals? ›

Manually Converting to Decimal Time

The whole number part before the decimal represents the hours, and the decimal part represents the fraction of an hour (in this case, the minutes). So, 2 hours and 30 minutes is equivalent to 2.5 hours in decimal form.

How do you convert decimals to hours and minutes in Excel? ›

1 Answer
  1. In cell B1 , type =MROUND(A1/24, 1/(24*60)) . This formula will round the decimal hours to the nearest minute.
  2. Press Enter.
  3. Now, let's format B1 to show time. Right-click on cell B1 and select Format Cells.
  4. From the Category list, choose Time.
  5. From the Type list, choose 13:30.
  6. Press OK.
Jul 27, 2023

How do you convert hours minutes and seconds? ›

Converting between hours, minutes, and seconds using decimal time is relatively straightforward:
  1. time in seconds = time in minutes * 60 = time in hours × 3600.
  2. time in minutes = time in seconds / 60 = time in hours × 60.
  3. time in hours = time in minutes / 60 = time in seconds / 3600.
6 days ago

What is the Timevalue function in Excel? ›

Returns the decimal number of the time represented by a text string. The decimal number is a value ranging from 0 (zero) to 0.99999999, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.).

How to convert time to seconds in Excel? ›

To convert a time value into seconds, you will multiply it by 86400 (the number of seconds in a day).
  1. Add a Header for Converted Times: In cell C1, type "Time in Seconds".
  2. Enter Conversion Formula: In cell C2, input the formula to convert the time in A2 into seconds: =A2*86400.
Apr 2, 2024

How do you convert HH MM to decimal in Excel? ›

Finally, you can copy and paste the new time data over the original.
  1. Open an Excel document containing a section with time data written in "hh:mm" format, such as "12:30."
  2. Click on an open cell off to the side of the first entry in the existing data. ...
  3. Type the formula "=(##-INT(##))*24" into the cell.

How to convert minutes and seconds to decimal? ›

How to Convert Time to Decimal
  1. 2 hours is 2 hours * (1 hour/ 1 hour) = 2 hours.
  2. 45 minutes is 45 minutes * (1 hour / 60 minutes) = 45/60 hours = 0.75 hours.
  3. 45 seconds is 45 seconds * (1 hour / 3600 seconds) = 45/3600 hours = 0.0125 hours.
  4. Adding them all together we have 2 hours + 0.75 hours + 0.0125 hours = 2.7625 hours.
Sep 7, 2023

How do you convert hours to minutes as a decimal? ›

In decimal time, each hour is divided into 100 units, and each unit represents 0.6 minutes (or 36 seconds). For example: 1 hour = 1.00. 30 minutes = 0.50.

How to convert hh mm ss to number in Excel? ›

Simply multiply your hh:mm durations by 24, ensuring that the cells where you want the decimal hours returned are formatted as 'Number'. Or to force formatting as a number using a formula: =text(duration_cell*24,"#. ##") where duration_cell is a cell with the duration in hh:mm format.

How do you convert hours and minutes to decimal in numbers? ›

Time Card Conversion Examples

Let's say another employee worked 7 hours and 45 minutes. To convert this to decimal form, you would divide the minutes worked by 60, which gives you 0.75. Then, you would add that decimal to the total number of hours worked, which gives you 7.75 hours.

Top Articles
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 6674

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.