Duration in Hours (or hh:mm:ss)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
=now()-prior cell

Format cell as time

Will change any time you type into the spreadsheet.
 
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
 
=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.
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top