Excel Time to Decimal Hours: Formula & Guide
In this article
To convert a time value in Excel to decimal hours, multiply the time by 24. For example, if cell A1 contains 3:30 (3 hours 30 minutes), the formula =A1*24 returns 3.5. This works because Excel stores times as fractional days, so multiplying by 24 converts the fraction into hours.
Why Excel Stores Time as a Fraction of a Day
Excel treats dates and times as serial numbers. A full day equals 1, so 12:00 PM is 0.5, 6:00 AM is 0.25, and 18:00 (6 PM) is 0.75. When you enter 3:30, Excel stores it as approximately 0.1458333 (3.5 hours ÷ 24 hours). This system allows date and time arithmetic to work naturally, but it also means that a time value alone does not directly display as a decimal number of hours.
To get the hour count, you multiply the fraction by 24. This is the core conversion used in payroll, project tracking, and any spreadsheet that needs hours as a plain number for further calculations.
The Basic Formula: Multiply by 24
The simplest and most reliable formula is:
=A1*24
Where A1 contains a valid Excel time. The result is the number of hours as a decimal. For example:
- 0:30 (30 minutes) → 0.5
- 1:15 → 1.25
- 2:45 → 2.75
- 8:00 → 8.0
If you want to see the result as a number with two decimals, format the cell as a number (Home → Number Format → Number) and set decimal places to 2 or more.
Handling Times That Cross Midnight
A common issue occurs when a time range spans midnight, such as from 22:00 (10 PM) to 02:00 (2 AM). If you simply subtract the start from the end, Excel returns a negative value because the end time is numerically smaller. To handle this, use a formula that adds 1 if the end is less than the start:
=IF(B1 < A1, (B1 - A1 + 1) * 24, (B1 - A1) * 24)
This checks if the end time (B1) is earlier than the start (A1). If so, it adds a full day (1) to the difference before multiplying by 24. This yields the correct decimal hours for overnight shifts.
Using HOUR, MINUTE, and SECOND Functions
An alternative approach is to break the time into components using the HOUR, MINUTE, and SECOND functions. This is useful when you need to manipulate parts separately or when the time is stored as text.
=HOUR(A1) + MINUTE(A1)/60 + SECOND(A1)/3600
For 3:30:00, HOUR(A1) returns 3, MINUTE(A1) returns 30, and SECOND(A1) returns 0. The formula gives 3 + 0.5 + 0 = 3.5. This method is more explicit but longer. It also avoids any issues if the time is stored as text, as long as the text is a valid time format.
Converting Text That Looks Like Time
Sometimes you import data where times are text strings, like "3:30" or "14:45". Multiplying text by 24 will not work directly. First, convert the text to a real time using the TIMEVALUE function:
=TIMEVALUE(A1)*24
TIMEVALUE("3:30") returns 0.1458333, which when multiplied by 24 gives 3.5. If the text includes a date, use the DATEVALUE function as well, but for pure times, TIMEVALUE is sufficient. If the text is not a valid time, the formula returns a #VALUE! error.
Formatting the Result Cell
After applying the formula, the result cell may still show a time format, which can be confusing. For example, if you multiply 0.1458333 by 24, you get 3.5, but if the cell is formatted as time, it displays as 12:00 PM (since 3.5 days is 84 hours, and 84 hours past midnight is 12:00 PM). To avoid this, always format the result cell as a number:
- Select the cell(s) with the formula.
- Go to the Home tab.
- In the Number group, click the dropdown and choose "Number".
- Increase decimal places as needed.
This ensures the cell shows 3.5 instead of a time value.
Common Mistakes and Pitfalls
- Forgetting to multiply by 24: Simply subtracting two times gives a fraction of a day, not hours. Always multiply by 24.
- Using single quotes around time: Entering '3:30 as text will not be treated as a time. Use proper time entry (3:30) or convert with TIMEVALUE.
- Formatting result as time: As noted, this leads to confusing displays. Use number format.
- Negative times for overnight shifts: Use the IF formula to add 1 day when needed.
- Rounding errors: Excel's floating-point arithmetic can cause tiny discrepancies, such as 0.1 being slightly off. Use ROUND if you need exact decimals:
=ROUND(A1*24, 2).
Frequently Asked Questions
How do I convert 8:30 to decimal hours?
Multiply the time by 24. If A1 contains 8:30, the formula =A1*24 returns 8.5. That represents 8 hours and 30 minutes, because 30 minutes is half an hour.
Can I convert a duration like 1:45 (1 hour 45 minutes) to 1.75?
Yes. Excel treats 1:45 as a time value equal to 0.0729167 days. Multiplying by 24 gives 1.75. The same formula works for any duration formatted as h:mm.
What if my time is in hours and minutes but I want minutes only?
Multiply the time by 1440 (24 * 60). For example, =A1*1440 converts 1:30 to 90 minutes. This is useful for billing or scheduling when you need minute-level precision.
Why does my formula return a time like 12:00 PM instead of a decimal?
The cell is formatted as a time. Change the number format to "Number" or "General" to see the decimal value. Right-click the cell, choose Format Cells, then select Number.
How do I handle times that include seconds?
The multiplication by 24 works automatically. For example, 1:30:30 (1 hour, 30 minutes, 30 seconds) becomes 1.508333 hours. If you need seconds precision, you can also use the HOUR/MINUTE/SECOND formula.
Is there a way to convert a decimal back to time?
Yes, divide the decimal hours by 24 and format the cell as time. For instance, 3.5 in A1, use =A1/24 and format as h:mm to get 3:30.