3 ways to convert time to decimal numbers in Excel and how to convert it back
How to convert time to decimal numbers in Excel
1. Use math
The simplest way to convert time to decimal in Excel is to multiply the original time value by the number of hours, minutes, and seconds in the day:
To convert time to hours, multiply the time by 24 (the number of hours in a day).
To convert time to minutes, multiply the time by 1440 (minutes in a day = 24 * 60).
To convert time to seconds, multiply the time by 86400 (number of seconds in a day = 24 * 60 * 60).
For example, we have the following time table:
In column B to calculate the time, use the formula B2=A2 *24, copy it to the remaining cells in column B, you will get the number of hours in decimal form.
Similarly, convert to minutes according to the formula: C2 =A2*24*60
Convert to seconds according to the formula: D2 =A2*24*60*60
2. Use the CONVERT function
Another way to perform time conversion to decimal is to use the CONVERT function
Function syntax: =CONVERT(number;from_unit;to_unit)
In there:
Number is the original number to be converted.
from_unit is the unit of the original number.
to_unit is the unit to convert.
Unit values:
'day' = if unit is day.
'hr' = unit is hour.
'mn' = unit is minute.
'sec' = unit is seconds.
With the above example, the default from_unit value is 'day', and you want to convert to hours, we have the formula:
=CONVERT(A2;'day';'hr')
To convert to minutes we have the formula:
=CONVERT(A2;'day';'mn') or: =CONVERT(B2;'hr';'mn')
To convert to seconds we have the formula:
=CONVERT(A2;'day';'sec') or =CONVERT(B2;'hr';'sec') or =CONVERT(C2;'mn';'sec')
3. Use the functions HOUR, MINUTE, SECOND
Finally, you can use a more complex formula. Export time units using the time functions HOUR, MINUTE, SECOND then use the summation operation.
Function syntax:
= HOUR(serial_number)
= MINUTE(serial_number)
= SECOND(serial_number)
In which: serial_number is the number to convert.
With the example above, you type the formula as follows:
B2 = HOUR (A2)
C2 = MINUTE (A2)
D2 = SECOND (A2)
To calculate the total number of hours in column E, the formula will be hours + minutes/60 + seconds/360
Formula: =B2+C2/60+D2/3600 . Copy the formula to the remaining rows in the column. You get the following results:
To calculate the total number of minutes in column F, the formula will be hours*60 + minutes + seconds/60
Formula: =B2*60+C2+D2/60 . Copy the formula to the remaining rows in the column. You get the following results:
To calculate the total number of seconds in column G, the formula will be hours*3600 + minutes*60 + seconds
Formula: =B2*3600+C2*60+D2 . Copy the formula to the remaining rows in the column. You get the following results:
You should read it
- How to fix the SUM function doesn't add up in Excel
- Guidance on how to align Excel correctly
- How to keep Excel and Excel columns fixed?
- What is ### error in Excel? how to fix ### error in Excel
- How to display 0 in front of a number in Excel
- Instructions for searching and replacing in Excel tables
- MS Excel 2007 - Lesson 2: Customizing in Excel
- 3 ways down the line in Excel, line break, down row in 1 Excel cell
May be interested
- How to draw straight lines and arrows in Excel - Draw shapes in Excelthere are many different ways to draw straight lines and arrows in excel. lines and arrows in excel are often used to draw mind maps in excel or graph functions in excel.
- Simple tips to help optimize your job search resumein an increasingly competitive labor market, to help employers distinguish between you and a crowd of applicants, you need to spend time tailoring your resume to suit each different job.
- 4 Free spreadsheet software that can replace Micorsoft Excelmicrosoft excel is still the number one name in the field of spreadsheet processing. however, the biggest problem here is that excel incurs expensive licensing fees. fortunately, there are a number of free spreadsheet software that can replace excel. please read the following article to choose the most suitable solution for yourself.
- Tips on how to copy charts from Excel to Word while maintaining the formatexcel and word are two software in microsoft's microsoft office suite. most users regularly use these two software. do you know how to copy charts from excel to word with the format intact? read this article for instructions on how to do it!
- What is the error 'Something went wrong'? Quick fix when using Wordwhat is the error 'something went wrong'? this is a fairly common error many people encounter when opening microsoft word. please follow the following article to know how to fix this error.
- The secret to creating bookmarks in Word is extremely fast and simple, anyone can do itwith a large number of pages, the content of your essay may be difficult for readers to find. to solve this problem, the following article will provide detailed instructions on creating bookmarks in word.