Wednesday, December 03, 2008   
  Search   
 
Register  Login  
Forums  
     Minimize  

Welcome to MeraWindows forums.

Thank you for being at the Microsoft Windows Community Site. You may have to register before posting in forums. It's absolutely free. After registering, you can get all the benefits available to our registered members, you can access our Downloads section, you can participate in contests, etc. You can post in forums in English as well as in Hindi, in fact we encourage you to use Hindi in your posts. If you have any problem with registration or login, please contact us.

     
  


 
  Microsoft Windows Forums  Microsoft Offic...  Microsoft Excel  Date and Time Calculation in Excel
Previous Previous
 
Next Next
New Post 1/29/2008 3:37 PM
User is offline Argha
12 posts
Member


Date and Time Calculation in Excel 

Hello,
Introduced to this forum by the great Excel-guru Mr. Ashish Mathur. ( Thanks Ashish, for your cooperation ). I use Excel for my MIS job in Telecom field in order to generate REPORTS and REPORTS. Hence at times I really need somebody to help me doing the same things in an even easier way if I cannot find a solution by myself.

Presently, I am stuck with a time-calculation problem. Let me summarize:

I have 4 columns containing "Start Date", "Start Time", "End Date" and "End Time" respectively.
In the 5th column, I need to calculate the time difference in terms of "Hours and Minutes" in the format [h]:mm
e.g., in the following table, I need a "1-cell formula" to get the value "35:50"

Start Date Start Time End Date End Time Difference
26-Jan-2008 10:40 27-Jan-2008 22:30 35:50

Please help.

 
New Post 1/29/2008 6:03 PM
User is offline Ashish Mathur
89 posts
www.ashishmathur.com
Member




Re: Date and Time Calculation in Excel 

Hi,

Assuming the data above is entered in range A12, enter the following formula in cell E2 to get the time difference.

=IF(B2>=D2,TEXT(12-(B2-D2),"hh:mm:ss")+(C2-IF(B2=D2,0,1))-A2,TEXT(D2-B2,"hh:mm:ss")+(C2-A2)).

In Format>Cells>Number.Custom, please enter the following time format in the Type box: [h]:mm:ss

Hope this solves your problem.

 


For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

 
New Post 1/30/2008 4:04 PM
User is offline Argha
12 posts
Member


Re: Date and Time Calculation in Excel 

Thank you very much. That solves my problem easily. Its like magic.

 
New Post 1/30/2008 5:18 PM
User is offline Vishal Gupta
6366 posts
www.AskVG.com
Ultimate Member








Re: Date and Time Calculation in Excel 

^^ Good to know and welcome to the forum.


Tweaking with Vishal

How to Use Smiley Code in Forum?
Promote MeraWindows at Your Blog / Site
Read Forum Guidelines
 
New Post 2/9/2008 1:52 PM
User is offline Argha
12 posts
Member


Re: Date and Time Calculation in Excel 

 Ashish Mathur wrote

Hi,

Assuming the data above is entered in range A12, enter the following formula in cell E2 to get the time difference.

=IF(B2>=D2,TEXT(12-(B2-D2),"hh:mm:ss")+(C2-IF(B2=D2,0,1))-A2,TEXT(D2-B2,"hh:mm:ss")+(C2-A2)).

In Format>Cells>Number.Custom, please enter the following time format in the Type box: [h]:mm:ss

Hope this solves your problem.

 

Hi Ashish,

As I was working with your formula, a sudden idea flashed in my mind, and yes, it worked. Now, I have been able to simplify the formula farther. Here it goes:

=TEXT((C2+D2)-(A2+B2),"[h]:mm:ss")

You know, we were thinking of complicated methods. In fact, Excel does not differentiate between date and time, both are treated as numbers, hence simple addition and subtraction is possible.

I wish we thought of it earlier. Anyway, better late than never.

-Argha Bagchi

http://www.linkedin.com/in/argha

 
Previous Previous
 
Next Next
  Microsoft Windows Forums  Microsoft Offic...  Microsoft Excel  Date and Time Calculation in Excel


   Get Your Own E-Mail Account @MeraWindows.com Minimize  
New Page 1 New Page 1
Show your cool quotient with @merawindows.com email account