[Newbie] time to minutes conversion

F

Fabien C.

Hello,

here is my problem : I've got a field that contains a time in the
format hh:mm (by example 01:30) for one hour and a half. I would like
to make a calculation with this (a cost, knowing the price for an
hour) so I need a macro that converts 01:30 in a decimal format (01:30
gives 1,5)... How can I do this... I'm sure there is an internal macro
wich is already implemented... But... I can't find it...

HELP !

thank you,

F.C
___________________________________________________________________
Mesure anti spam : dans mon adresse electronique, remplacer .com par .fr
 
C

Chip Pearson

Multiply your time value by 24.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


Fabien C. said:
Hello,

here is my problem : I've got a field that contains a time in the
format hh:mm (by example 01:30) for one hour and a half. I would like
to make a calculation with this (a cost, knowing the price for an
hour) so I need a macro that converts 01:30 in a decimal format (01:30
gives 1,5)... How can I do this... I'm sure there is an internal macro
wich is already implemented... But... I can't find it...

HELP !

thank you,

F.C
_________________________________________________________________
__
Mesure anti spam : dans mon adresse electronique, remplacer
..com par .fr
 
J

JE McGimpsey

XL stores time as fractional days (e.g., 03:00 = 8/24 = 0.125), so to
get hours, multiply by 24

A1: 01:30
A2: =A1 * 24 ==> 1.5

Format A2 as General or another numeric format.
 
F

Fabien C.

Thank you guys ! That's all I needed !!!!

F.
___________________________________________________________________
Mesure anti spam : dans mon adresse electronique, remplacer .com par .fr
 

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