ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calculating hours (https://www.excelbanter.com/excel-programming/349533-calculating-hours.html)

JT

calculating hours
 
I have a macro that is putting the (1) start date, (2) start time, (3), end
date, and (4) end time in 4 separate fields. What I need to do is calculate
the number of hours between (1) the start date and time AND (2) the end date
and time.

I've tried combining the date and time for both the start and end but I'm
not having much luck getting good values. Once I get these combined, I was
going to subtract the values and then use the "quotient" function to get the
number of days and then the "mod" function to get the remainder (which I use
to determine if another day is added to the total.

Any suggestions on how to best accomplish this or other methods to get the
number of hours (in days) and the remainder is greatly appreciated. Thanks
for the help.........
--
JT

Tim Williams

calculating hours
 
((end_date+end_time)-(start_date+start_time))*24

Tim

--
Tim Williams
Palo Alto, CA


"JT" wrote in message
...
I have a macro that is putting the (1) start date, (2) start time, (3),

end
date, and (4) end time in 4 separate fields. What I need to do is

calculate
the number of hours between (1) the start date and time AND (2) the end

date
and time.

I've tried combining the date and time for both the start and end but I'm
not having much luck getting good values. Once I get these combined, I

was
going to subtract the values and then use the "quotient" function to get

the
number of days and then the "mod" function to get the remainder (which I

use
to determine if another day is added to the total.

Any suggestions on how to best accomplish this or other methods to get the
number of hours (in days) and the remainder is greatly appreciated.

Thanks
for the help.........
--
JT





All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com