Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time Difference between two dates

Hi,

The basic objective of myself is to get the Time difference of tw
dates.

1. I am using excell macro for inserting the date and time into th
excel sheet.

2. The Start date, Start time, EndDate and EndTime are inserting int
four different cells of excell from a *.csv file using the exce
macro.

3. All the things are happening. But I need to calculate the tim
difference between the start time and End time.

After reading the excel help I came to know that the excel need th
Start Time and End Time in "Date & Time Format" in single cell itsel
then only the difference can be calculated using "=A1-B1".
For example:
A1 = 18/04/2004 19:00:00
B1 = 19/04/2004 21:00:00

Since the excell needs the date and time to be entered in one cell it
getting tougher for me.

Because the excell macro is inserting the decimal value(instead o
inserting in time format) into the excel cell eventhough its availabl
in the csv file in exact time format.

For inserting only the time there is no problem for me , since I hav
the option of individuual cell format. I had set the cell format int
"hh:mm:ss".

Please tell me what format should I use to get the date&Time in on
cell as "dd/mm/yyyy hh:mm:ss" (eg:19/04/2004 21:00:00)

I had tried Format cell, then I had selected Custum and enter th
"dd/mm/yyyy hh:mm:ss" after that the date is showing correctly but th
time is still in decimal format only.

If I get the date&time is the above mention form then I will be able t
get time difference between two dates.

Note: My system Date Format is dd/mm/yyyy and Time Format is HH:mm:ss


Please help me to get rid of this problem at the earliest.

Looking forward for your valuable reply

Thanking you
Yours Sincerly

Deepak C Mohan
-------------------------------
Project Leader - S.C.A.D.A
Protocol Automation Technologies Pvt Ltd.
Bangalore - 25
India.
Asia

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Time Difference between two dates

you don't have to have them in one cell

=(End_Date + End_Time) - (Start_Date + Start_Time)

format the result cell (cell with the above formula) as
[hh]:mm with a custom number format if you want the results in hours and
minutes.

--
Regards,
Tom Ogilvy

"DeepaK " wrote in message
...
Hi,

The basic objective of myself is to get the Time difference of two
dates.

1. I am using excell macro for inserting the date and time into the
excel sheet.

2. The Start date, Start time, EndDate and EndTime are inserting into
four different cells of excell from a *.csv file using the excel
macro.

3. All the things are happening. But I need to calculate the time
difference between the start time and End time.

After reading the excel help I came to know that the excel need the
Start Time and End Time in "Date & Time Format" in single cell itself
then only the difference can be calculated using "=A1-B1".
For example:
A1 = 18/04/2004 19:00:00
B1 = 19/04/2004 21:00:00

Since the excell needs the date and time to be entered in one cell its
getting tougher for me.

Because the excell macro is inserting the decimal value(instead of
inserting in time format) into the excel cell eventhough its available
in the csv file in exact time format.

For inserting only the time there is no problem for me , since I have
the option of individuual cell format. I had set the cell format into
"hh:mm:ss".

Please tell me what format should I use to get the date&Time in one
cell as "dd/mm/yyyy hh:mm:ss" (eg:19/04/2004 21:00:00)

I had tried Format cell, then I had selected Custum and enter the
"dd/mm/yyyy hh:mm:ss" after that the date is showing correctly but the
time is still in decimal format only.

If I get the date&time is the above mention form then I will be able to
get time difference between two dates.

Note: My system Date Format is dd/mm/yyyy and Time Format is HH:mm:ss


Please help me to get rid of this problem at the earliest.

Looking forward for your valuable reply

Thanking you
Yours Sincerly

Deepak C Mohan
-------------------------------
Project Leader - S.C.A.D.A
Protocol Automation Technologies Pvt Ltd.
Bangalore - 25
India.
Asia.


---
Message posted from http://www.ExcelForum.com/



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
difference between two dates and before a certain time Jackajoo Excel Discussion (Misc queries) 2 August 27th 09 11:13 PM
Difference between 2 dates&time(format 0000), and excludes weekend YY san.[_2_] Excel Worksheet Functions 2 April 15th 09 02:40 AM
subtract the time difference from another time difference Dannigirl Excel Discussion (Misc queries) 3 September 30th 07 03:47 PM
Time difference calculations, daylight savings time, Excel Tim Excel Discussion (Misc queries) 1 December 28th 06 04:18 PM
HOURS DIFFERENCE IN TIME BETWEEN DIFFERENT DATES AND TIMES tankerman Excel Worksheet Functions 1 September 13th 05 04:31 PM


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

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

About Us

"It's about Microsoft Excel"