Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default More than 24 hours

I try to use VBA code for calculation time:
If TimePerTask*NumberOfTask<23:59 then their is no problem. The problem
occurs when TimePerTask*NumberOfTask24:00. I have tried different ways, but
the answer is always the same. Ex:TimePerTask=1:00 * NumberOfTask=32 gives
the result 8:00. The 24 hours is not showed, in the editor I can see the
result 1989-12-31 08:00.
What to do? Thanks in advance.

Olle Humble


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default More than 24 hours

= 24*(SumProduct (timepertask, numberoftasks)). Format answer as number

Mike F
"Olle Humble" wrote in message
...
I try to use VBA code for calculation time:
If TimePerTask*NumberOfTask<23:59 then their is no problem. The problem
occurs when TimePerTask*NumberOfTask24:00. I have tried different ways,
but the answer is always the same. Ex:TimePerTask=1:00 * NumberOfTask=32
gives the result 8:00. The 24 hours is not showed, in the editor I can see
the result 1989-12-31 08:00.
What to do? Thanks in advance.

Olle Humble



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default More than 24 hours

Hi Olle,

I guess you variable is declared as date?

Basically, don't worry about it, it is still holding 32 hours in the value.
To prove this, format cell A1 on a worksheet as [hh]:mm. Then drop your
variable in there

Range("A1").Value = TimePerTask

you will 32:00 in there.

Basically, Excel/VBA holds time as a fraction of one day, so 32 hours =
1.3333333333 etc., and you can work with that happily.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Olle Humble" wrote in message
...
I try to use VBA code for calculation time:
If TimePerTask*NumberOfTask<23:59 then their is no problem. The problem
occurs when TimePerTask*NumberOfTask24:00. I have tried different ways,

but
the answer is always the same. Ex:TimePerTask=1:00 * NumberOfTask=32 gives
the result 8:00. The 24 hours is not showed, in the editor I can see the
result 1989-12-31 08:00.
What to do? Thanks in advance.

Olle Humble




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
sumif and translate annual hours into weekly quarter hours se7098 Excel Worksheet Functions 23 October 11th 08 01:37 AM
Converting total number of hours (24 hours) into days MV Rao Excel Discussion (Misc queries) 1 January 24th 08 12:50 PM
wages - multiply hours and minutes by number of hours worked Carol (Australia) Excel Discussion (Misc queries) 6 April 1st 07 01:16 AM
Drivers Hours Timesheet - Calculate Hours Worked on Weekly Basis Graham Excel Discussion (Misc queries) 2 January 28th 07 08:40 PM
Convert hours and minutes in time format into fractions of hours.. Akern Excel Worksheet Functions 4 April 21st 05 02:56 PM


All times are GMT +1. The time now is 10:13 PM.

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

About Us

"It's about Microsoft Excel"