Learn Excel from MrExcel Episode 902 - Decimal Hours

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Dec 10, 2008.
Calculate time difference and show the result as a decimal number of hours. Episode 902 will show you how.
maxresdefault.jpg


Transcript of the video:
Welcome back to the MrExcel netcast, I'm Bill Jelen.
Now, today's question’s sent in by Greg.
Greg is dealing with a worksheet where he has some times, and needs to figure out the difference between the two times.
And so normally, we would just set up a little formula-- C - B. And look at this result 2:26:21 AM; that's saying 2 hours and 46 minutes-- 46 minutes.
Well, that's not how Greg wants to show it-- he needs to show the number of hours and then a decimal point and the fractional number of hours.
So, you know, this might be 2.76 hours or something like that.
The way that Excel stores time is, it's a decimal between 0 and 1.
So for example, 6 hours would be 0.25 because it's 25% of a day.
So the solution here, is to take that subtraction and just multiply the whole thing * 24.
Now, we're going to get the wrong answer here; we need to go in and use Format Cells.
I press Ctrl+1 and switch this back to a number with however many decimal places you'd like to see.
So I'll go to one decimal place, will click OK, and you see that we now have an answer.
And when we copy that down-- the number of the formatting-- we can actually see the decimal number of hours.
The nice thing about this is it's easy to total up, even if it's in excess of 24 hours, because we're actually dealing with integers.
Now, we don't have that problem where Excel cuts off the number of hours above 24 and you have to use the secret number format.
So using this, multiplying the time calculation by 24 to convert to hours, great way to go.
I think that'll solve Craig's problem.
Well, I want to thank you for stopping by, we'll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,216,505
Messages
6,131,026
Members
449,616
Latest member
PsychoCube

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