ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Length of time from date/time custom format (https://www.excelbanter.com/excel-discussion-misc-queries/243259-length-time-date-time-custom-format.html)

Andrew

Length of time from date/time custom format
 
I am working with a database that uses one of the custom date/time formats,
specifically m/d/yyyy h:mm. I want to calculate the time difference between
two cells in this format; however, when I do a simple subtraction (for
example =A1-B1) the result is displayed again as a date and time. What I want
is to be able to determine the difference in time between the two values (for
example, the difference between 1/2/2000 13:00 and 1/1/2000 12:00 would be 1
day, 1 hour (or 25 hours, or 1500 minutes). I appreciate any advice!


Jacob Skaria

Length of time from date/time custom format
 
Do the normal substration and format the formula cell to [h]:mm:ss
--
If this post helps click Yes
---------------
Jacob Skaria


"Andrew" wrote:

I am working with a database that uses one of the custom date/time formats,
specifically m/d/yyyy h:mm. I want to calculate the time difference between
two cells in this format; however, when I do a simple subtraction (for
example =A1-B1) the result is displayed again as a date and time. What I want
is to be able to determine the difference in time between the two values (for
example, the difference between 1/2/2000 13:00 and 1/1/2000 12:00 would be 1
day, 1 hour (or 25 hours, or 1500 minutes). I appreciate any advice!


Pete_UK

Length of time from date/time custom format
 
You can subtract them like you have tried, but you need to give the
cell with the formula in a different format, using Custom, such as:

[h]" hours"

or:

[m]" minutes"

Hope this helps.

Pete

On Sep 21, 4:02*pm, Andrew wrote:
I am working with a database that uses one of the custom date/time formats,
specifically m/d/yyyy h:mm. I want to calculate the time difference between
two cells in this format; however, when I do a simple subtraction (for
example =A1-B1) the result is displayed again as a date and time. What I want
is to be able to determine the difference in time between the two values (for
example, the difference between 1/2/2000 13:00 and 1/1/2000 12:00 would be 1
day, 1 hour (or 25 hours, or 1500 minutes). I appreciate any advice!




All times are GMT +1. The time now is 02:01 PM.

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