Convert Date & hour to decimal

E

Everett Joline

If I have a column of values with a format like 9/2/2005 4:30, how
do I convert that to decimal hours after (say) 1/1/2005 0:0?
Also, is 4:30 routinely treated as HH:MM or might it be interpreted as
MM:SS?
Thanks,
E-Jo
 
A

Andy B

Hi
Take the earlier date/time from the later one and format the result as [hh]

Andy.
 
J

JE McGimpsey

XL stores dates as integral offsets from a base date, and times as
fractional days, so you can do simple math (multiplying by 24 to convert
days and fractional days to hours):


A1: 9/2/2005
B1: =(A1-Date(2005,1,1))*24

An entry of 4:30 will be interpreted as 4 hours, 30 minutes, and
converted and stored as 0.1875 (regardless of how it's displayed).
 
D

David McRitchie

Hi Everett,
A1: =NOW()
B1: =MOD(A1,1)
C1: =B1 * 24 format as 0.0 to get decimal hours

Yes 4:30 would be 4 hours 30 minutes,
you would have to enter 0:4:30 for 4 minutes 30 seconds
 
E

Everett Joline

OK, I think I'm finally starting to understand. You guys
certainly expedited the process with your instructions
and examples.
So thanks Andy JE and David for your help,
E-Jo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top