ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Duration in Hours (or hh:mm:ss) (https://www.excelbanter.com/excel-worksheet-functions/153437-duration-hours-hh-mm-ss.html)

MJW[_2_]

Duration in Hours (or hh:mm:ss)
 
Hi All,

I'm currently trying to create a column in a sheet which calculates the age
in hours (or hours and minutes, though hours is optimal) that have elapsed
since the date/time stamp in the column which proceeds it. Is there any way
to manage this outside of a VBA solution? I'm about as green as it gets when
it comes to VBA, and I'm sort of surprised to find that there isn't a
standard function (like datedif) which supports this. Any help would be
greatly appreciated.

Thanks

Jamie


Sean Timmons

Duration in Hours (or hh:mm:ss)
 
=now()-prior cell

Format cell as time

Will change any time you type into the spreadsheet.

"MJW" wrote:

Hi All,

I'm currently trying to create a column in a sheet which calculates the age
in hours (or hours and minutes, though hours is optimal) that have elapsed
since the date/time stamp in the column which proceeds it. Is there any way
to manage this outside of a VBA solution? I'm about as green as it gets when
it comes to VBA, and I'm sort of surprised to find that there isn't a
standard function (like datedif) which supports this. Any help would be
greatly appreciated.

Thanks

Jamie


MJW[_2_]

Duration in Hours (or hh:mm:ss)
 
Thanks Sean--I considered using "NOW()", but was hung up on the dynamic
nature you mentioned. Of course I just realized moments ago that I'll be
saved as long as I only update it when the data's needed--once I make a pivot
of the data and port that over to the master workbook, it'll be a static
value.

Much appreciated!

--Jamie

"Sean Timmons" wrote:

=now()-prior cell

Format cell as time

Will change any time you type into the spreadsheet.

"MJW" wrote:

Hi All,

I'm currently trying to create a column in a sheet which calculates the age
in hours (or hours and minutes, though hours is optimal) that have elapsed
since the date/time stamp in the column which proceeds it. Is there any way
to manage this outside of a VBA solution? I'm about as green as it gets when
it comes to VBA, and I'm sort of surprised to find that there isn't a
standard function (like datedif) which supports this. Any help would be
greatly appreciated.

Thanks

Jamie


David Biddulph[_2_]

Duration in Hours (or hh:mm:ss)
 
=NOW()-A1 and format the cell appropriately, such as [h]:mm

If you want it converting to decimal hours, use =24*(NOW()-A1) and format as
General or number.
--
David Biddulph

"MJW" wrote in message
...
Hi All,

I'm currently trying to create a column in a sheet which calculates the
age
in hours (or hours and minutes, though hours is optimal) that have elapsed
since the date/time stamp in the column which proceeds it. Is there any
way
to manage this outside of a VBA solution? I'm about as green as it gets
when
it comes to VBA, and I'm sort of surprised to find that there isn't a
standard function (like datedif) which supports this. Any help would be
greatly appreciated.

Thanks

Jamie




David Biddulph[_2_]

Duration in Hours (or hh:mm:ss)
 
If you don't want to use NOW(), you can put current time into a cell with
control-shift-colon, or current date with control-semi-colon, or both
together with control-semi-colon space control-shift-colon.
--
David Biddulph

"MJW" wrote in message
...
Thanks Sean--I considered using "NOW()", but was hung up on the dynamic
nature you mentioned. Of course I just realized moments ago that I'll be
saved as long as I only update it when the data's needed--once I make a
pivot
of the data and port that over to the master workbook, it'll be a static
value.


"Sean Timmons" wrote:

=now()-prior cell

Format cell as time

Will change any time you type into the spreadsheet.


"MJW" wrote:

Hi All,

I'm currently trying to create a column in a sheet which calculates the
age
in hours (or hours and minutes, though hours is optimal) that have
elapsed
since the date/time stamp in the column which proceeds it. Is there
any way
to manage this outside of a VBA solution? I'm about as green as it
gets when
it comes to VBA, and I'm sort of surprised to find that there isn't a
standard function (like datedif) which supports this. Any help would
be
greatly appreciated.

Thanks

Jamie




Peo Sjoblom

Duration in Hours (or hh:mm:ss)
 
Note that using Ctrl + colon will truncate the seconds, so even if the
computer's clock is 09:23:58 it will come out as 09:23:00.



--
Regards,

Peo Sjoblom



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
If you don't want to use NOW(), you can put current time into a cell with
control-shift-colon, or current date with control-semi-colon, or both
together with control-semi-colon space control-shift-colon.
--
David Biddulph





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

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