Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default subtracting date and time to find the difference between the two

I was wondering if anyone could help as I've spent a lot of time on
this and can't quite get this calculation to work. I am trying to find
out how long in time (24-hour clock) there is between A1 and B1 taking
into consideration the date.

Okay, here is my problem:

In A1 I have 08/04/2007 01:57:56
In A2 I have 09/04/2007 21:46:57
In A3 I have the formula =B2-A1
(all these cells are formatted as custom: dd/mm/yyyy hh:mm:ss)

The answer I get in A3 is 01/01/1900 19:49:01

Now, as far as I can see, there are indeed 19 hours, 49 minutes and 1
second time difference between the two cells (correct me if I'm
wrong), but the date is all wrong. The main thing I need is how many
days difference there is in addition to the time. In this case, there
are no whole days past between the two dates, but it does go through
midnight. From the result it seems there is a day difference (i.e. 19
hours, 49 minutes and 1 second time + 24 hours!).

I need to do this for a whole bunch of data with varying number of
days between each cell and I want to make sure I've got the formula
right. Does anyone know the correct formula please?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default subtracting date and time to find the difference between the two

1. the difference is 49 hours 49 minutes and 1 second

2. format your cell to d [g]:mm:ss;@ or dd [g]:mm:ss;@ to see days and
hours...

pls click YES if this helped



On 27 Maj, 23:00, fluff wrote:
I was wondering if anyone could help as I've spent a lot of time on
this and can't quite get this calculation to work. I am trying to find
out how long in time (24-hour clock) there is between A1 and B1 taking
into consideration the date.

Okay, here is my problem:

In A1 I have 08/04/2007 01:57:56
In A2 I have 09/04/2007 21:46:57
In A3 I have the formula =B2-A1
(all these cells are formatted as custom: dd/mm/yyyy hh:mm:ss)

The answer I get in A3 is 01/01/1900 19:49:01

Now, as far as I can see, there are indeed 19 hours, 49 minutes and 1
second *time difference between the two cells (correct me if I'm
wrong), but the date is all wrong. The main thing I need is how many
days difference there is in addition to the time. In this case, there
are no whole days past between the two dates, but it does go through
midnight. From the result it seems there is a day difference (i.e. 19
hours, 49 minutes and 1 second time + 24 hours!).

I need to do this for a whole bunch of data with varying number of
days between each cell and I want to make sure I've got the formula
right. Does anyone know the correct formula please?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default subtracting date and time to find the difference between the two

On 27 May, 22:11, Jarek Kujawa wrote:
1. the difference is 49 hours 49 minutes and 1 second

2. format your cell to d [g]:mm:ss;@ or dd [g]:mm:ss;@ to see days and
hours...

pls click YES if this helped

On 27 Maj, 23:00, fluff wrote:

I was wondering if anyone could help as I've spent a lot of time on
this and can't quite get this calculation to work. I am trying to find
out how long in time (24-hour clock) there is between A1 and B1 taking
into consideration the date.


Okay, here is my problem:


In A1 I have 08/04/2007 01:57:56
In A2 I have 09/04/2007 21:46:57
In A3 I have the formula =B2-A1
(all these cells are formatted as custom: dd/mm/yyyy hh:mm:ss)


The answer I get in A3 is 01/01/1900 19:49:01


Now, as far as I can see, there are indeed 19 hours, 49 minutes and 1
second *time difference between the two cells (correct me if I'm
wrong), but the date is all wrong. The main thing I need is how many
days difference there is in addition to the time. In this case, there
are no whole days past between the two dates, but it does go through
midnight. From the result it seems there is a day difference (i.e. 19
hours, 49 minutes and 1 second time + 24 hours!).


I need to do this for a whole bunch of data with varying number of
days between each cell and I want to make sure I've got the formula
right. Does anyone know the correct formula please?


Perfect! That has worked fine now. Many thanks for your help.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtracting Dates to Find the Difference in Hours Workbook Excel Worksheet Functions 6 January 31st 09 12:16 AM
subtracting date/time Nathan Excel Worksheet Functions 8 January 29th 09 03:29 AM
Subtracting first and last values in a row to find net difference Tropikat Excel Worksheet Functions 10 October 7th 08 10:56 PM
find the difference between start time and end time when spanning. wahoos Excel Discussion (Misc queries) 8 January 18th 08 06:02 PM
Subtracting Date/Time Sapphyre Excel Discussion (Misc queries) 4 August 21st 07 01:42 AM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"