convert decimal to time

G

Guest

i want to know how to change the decimal to time format.

eg: when i enter the time as 9.30 i want that to be changed as 9:30 and
also when i enter the time as 1.38 to be changed as 13:38

Thnak you
 
B

Bob Phillips

=time(INT(A1),MOD(A1,1)*100,0)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

Roger Govier

Hi

In order to deal with the second part of your request, you would need to
modify Bob's formula with something like

=TIME(INT(A1)+12*(INT(A1)<8),MOD(A1,1)*100,0)

Any times which are less than 8, would have 12 hours added to make them
PM instead of AM.
Change the 8 to whatever value suits your purpose.
 
G

Guest

Thank you very match....

Roger Govier said:
Hi

In order to deal with the second part of your request, you would need to
modify Bob's formula with something like

=TIME(INT(A1)+12*(INT(A1)<8),MOD(A1,1)*100,0)

Any times which are less than 8, would have 12 hours added to make them
PM instead of AM.
Change the 8 to whatever value suits your purpose.
 

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