Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 69
Default Huge problem with time

hello. I have a problem here which I don't know that can be solved.

I need to transform some decimals to time and in another column know the
time in days.

I have this e columns:
34 0,875 34,875

if I divide by 24 and format as time I have this:
10:00 0:52 10:52

The problem is when the sum is bigger then 24 hours, so I have this:
0,13 0,91 1,04

And is show me this:
3:00 21:52 0:52

and I need this:
3:00 21:52 24:52

But if I format all column with this format: [h]:mm:ss;@

In the first example I have get this:
10:00 0:52 34:52:30

How can I fix this?


Thanks,
Marco





  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Huge problem with time

Assuming these are decimal hours thus if you format as [h]:mm:ss
and divide them with 24 you should get

34:00:00
0:52:30
34:52:30

and that is what I get if I do the same so apparantly you haven't formatted
the cell that returns 10:00



--


Regards,


Peo Sjoblom



"Marco" wrote in message
...
hello. I have a problem here which I don't know that can be solved.

I need to transform some decimals to time and in another column know the
time in days.

I have this e columns:
34 0,875 34,875

if I divide by 24 and format as time I have this:
10:00 0:52 10:52

The problem is when the sum is bigger then 24 hours, so I have this:
0,13 0,91 1,04

And is show me this:
3:00 21:52 0:52

and I need this:
3:00 21:52 24:52

But if I format all column with this format: [h]:mm:ss;@

In the first example I have get this:
10:00 0:52 34:52:30

How can I fix this?


Thanks,
Marco







  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Huge problem with time

I not sure if your time is in hours or days. But the code below should get
your answer. I find the only way to get hours when they are greater than 24
is to use the last line of the code below (or similar). You have to count the
number of days and multiply by 24 then add to the number of hours. You need
to use the format statement to make sure you have a two digit number of
minutes. Nobody like to see 6:2 when we are use to 6:02.

TimeDays = 34.875
WholeDays = Int(TimeDays)
FractDays = TimeDays - WholeDays
Hours = Hour(FractDays) + (24 * WholeDays)
TextTime = Hours & ":" & Format(Minute(FractDays), "#00")

"Marco" wrote:

hello. I have a problem here which I don't know that can be solved.

I need to transform some decimals to time and in another column know the
time in days.

I have this e columns:
34 0,875 34,875

if I divide by 24 and format as time I have this:
10:00 0:52 10:52

The problem is when the sum is bigger then 24 hours, so I have this:
0,13 0,91 1,04

And is show me this:
3:00 21:52 0:52

and I need this:
3:00 21:52 24:52

But if I format all column with this format: [h]:mm:ss;@

In the first example I have get this:
10:00 0:52 34:52:30

How can I fix this?


Thanks,
Marco





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Add-in in Excel 2003 - Huge Problem Irfan Khan[_2_] Excel Discussion (Misc queries) 5 December 13th 07 08:37 AM
huge problem tomro1 Excel Discussion (Misc queries) 0 June 13th 06 09:30 AM
huge problem with 1 excel doc ajisgod Excel Discussion (Misc queries) 2 August 22nd 05 11:37 AM
Huge problem with "if" formula's [email protected] Excel Discussion (Misc queries) 16 July 20th 05 07:20 PM
import problem on huge xls file f_huba@toplita. Excel Worksheet Functions 2 November 5th 04 12:09 AM


All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"