Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time calculations in VBA


hai guys,
i am also here with the similar problem.
here is the situation.
there are 4 list's for start time & end time
A B C D E
1 st time | end time| hours
2 HH MM | HH MM |
3 -------------------------
4 5 00 6 30 1:30 ( what i am doing here to get the value for this cel
is E4=TEXT(TIME(a4,b4,0)-TIME(C4,D4,0),"hh:mm")
and this cell is in time format like "13:30"
Now i don't want this to be like 1.30, instead i want like in 1.50Hrs
for calculation based on hours comsumed).

And, i am using this E4 cell in VBA.
there are similar rows like 4. and i want to add the Hours(E) column
i.e
if E4 =1.50, E5=2.75 then i need to get 4.25.
how to do this in VBA.
plz help me
Thanks & regards,
Mahes

--
itsmahesh
-----------------------------------------------------------------------
itsmaheshp's Profile: http://www.excelforum.com/member.php...fo&userid=1585
View this thread: http://www.excelforum.com/showthread.php?threadid=27689

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time calculations in VBA


Mahesh,

what you are currently doing is that you are converting the result to a
string by using TEXT. Now coming to your main problem of depicting 1:30
as 1.5. Date/Time is represented in excel using numbers and 1 day is
equivalent to 1 unit. As you see the base is DAY. Now sinve you want
the base as HOUR, you can simply multiply your result by 24. This will
give you the required 1.5 instead of 1:30. Also remember to format this
as a number and not date/time.


--
mangesh_yadav


------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=276891

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
Time calculations for Scheduled vs Actual Employee Time and Wages The Caterer Excel Discussion (Misc queries) 4 November 29th 09 11:51 PM
Time calculations for Scheduled Time vs. Actual Time Worked The Caterer Excel Discussion (Misc queries) 1 November 29th 09 08:08 AM
Time calculations for Scheduled vs Actual Employee Time and Wages The Caterer Excel Discussion (Misc queries) 2 November 29th 09 12:20 AM
Time difference calculations, daylight savings time, Excel Tim Excel Discussion (Misc queries) 1 December 28th 06 04:18 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM


All times are GMT +1. The time now is 08:06 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"