Excel hours

In Excel, dates are just serial numbers, so a single day has the numeric value of 1. This means 12 hours is the same as 0.5, 18 hours is the same as .75, and so on. Therefore, 1 hour = 1/24 = 0.041666667. In other words, hours are just fractional parts of a day:

Time Value Hours
3:00 AM 0.125 3
6:00 AM 0.25 6
9:00 AM 0.375 9
12:00 PM 0.5 12
3:00 PM 0.625 15
6:00 PM 0.75 18
9:00 PM 0.875 21
12:00 AM 1 24

To convert these fractional values to decimal hours, just multiply by 24. For example .5 * 24 = 12 hours, .24 * 24 = 6 hours, etc.

Durations over 24 hours

To calculate and display time durations over 24 hours, you'll want to use a custom time format like [h]:mm. Otherwise, the duration will "reset" every 24 hours, in the same way that a clock "resets" each day. More on custom number formats here.