ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Subtracting two times in hh:mm:ss format (https://www.excelbanter.com/excel-discussion-misc-queries/18908-subtracting-two-times-hh-mm-ss-format.html)

A Khan

Subtracting two times in hh:mm:ss format
 
I need to subtract two times that are in hh:mm:ss format and they occur on
different dates. Example:
Time 1:
03/22/2005 19:09:47
Time 2:
03/23/2005 01:02:51
Result = Time 2 - Time 1

I've tried different things but I keep getting #VALUE! in the result cell.
Any help would be appreciated.

Thanks.

Jason Morin

=ABS(MOD(B1,1)-MOD(A1,1))

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to subtract two times that are in hh:mm:ss format

and they occur on
different dates. Example:
Time 1:
03/22/2005 19:09:47
Time 2:
03/23/2005 01:02:51
Result = Time 2 - Time 1

I've tried different things but I keep getting #VALUE!

in the result cell.
Any help would be appreciated.

Thanks.
.


Jason Morin

=ABS(MOD(B1,1)-MOD(A1,1))

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to subtract two times that are in hh:mm:ss format

and they occur on
different dates. Example:
Time 1:
03/22/2005 19:09:47
Time 2:
03/23/2005 01:02:51
Result = Time 2 - Time 1

I've tried different things but I keep getting #VALUE!

in the result cell.
Any help would be appreciated.

Thanks.
.


Bob Phillips

Make sure the cells are correctly formatted as date and time.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"A Khan" <A wrote in message
...
I need to subtract two times that are in hh:mm:ss format and they occur on
different dates. Example:
Time 1:
03/22/2005 19:09:47
Time 2:
03/23/2005 01:02:51
Result = Time 2 - Time 1

I've tried different things but I keep getting #VALUE! in the result cell.
Any help would be appreciated.

Thanks.




Arvi Laanemets

Hi

=Time2-Time1+(Time2<Time1)


Arvi Laanemets


"A Khan" <A wrote in message
...
I need to subtract two times that are in hh:mm:ss format and they occur on
different dates. Example:
Time 1:
03/22/2005 19:09:47
Time 2:
03/23/2005 01:02:51
Result = Time 2 - Time 1

I've tried different things but I keep getting #VALUE! in the result cell.
Any help would be appreciated.

Thanks.





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

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