Convert hh:mm:ss to decimal time

vickersja

New Member
Joined
Jul 14, 2007
Messages
8
Hello,

I am having problems converting hours, minutes, and seconds to decimal time.

Example:

I have 08:32:24 in cell A1.

I use this formula in B1: =(A1-INT(A1))*24

But I get the #VALUE! error. I tried chaning the format of the cell, but that didnt work.

I know there is a way to manually calculate out the minutes and seconds, but I need to do this for many differnet fields with different values, so I am looking for a quick formuala.

Any help would be appreciated. Thank you.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Your formula is sound, works for me whether A1 is entered as a time value or a text value.

Excel Workbook
ABC
108:32:248.54TEXT
28:32:248.54TIME
Sheet3
 
Upvote 0
You may have some other characters in the cell, try this formula to extract just the time and multiply by 24

=LEFT(A1,FIND(":",A1)+5)*24

format result cell as number
 
Upvote 0
Thank you. Here is the odd thing. When I use the exact same formula in excel, I am still getting the Value error.

But when I copy and paste from you post into excel, it works fine. Im not sure why...
 
Upvote 0
Hello,

I am having problems converting hours, minutes, and seconds to decimal time.

Example:

I have 08:32:24 in cell A1.

I use this formula in B1: =(A1-INT(A1))*24

But I get the #VALUE! error. I tried chaning the format of the cell, but that didnt work.

I know there is a way to manually calculate out the minutes and seconds, but I need to do this for many differnet fields with different values, so I am looking for a quick formuala.

Any help would be appreciated. Thank you.

I could get a value error if there was a space in front of the time
try
Code:
=(trim(A1)-INT(trim(A1)))*24
 
Upvote 0
Your formula is sound, works for me whether A1 is entered as a time value or a text value.

Excel Workbook
ABC
108:32:248.54TEXT
28:32:248.54TIME
Sheet3

Hi, I wanted to pick this up again. The formula works, but how would I do it if it were to look something like this? 168:08:00
 
Upvote 0
Hi, I wanted to pick this up again. The formula works, but how would I do it if it were to look something like this? 168:08:00
Since you are only entering a time value, this seems to work...

=24*TRIM(A1)

but after entering the formula, you have to format the cell as General.
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,404
Members
449,156
Latest member
LSchleppi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top