Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RawisTheGameHhH
 
Posts: n/a
Default Need a function that calculates time between 2 dates


I have been playing around with a function that will give me the
difference between to dates and times.

Example:
A1 contains 6/10/06 10:00AM
A2 contains 6/13/06 10:00PM

I am trying to get a function to give me an answer with how many days,
hours and minutes between the 2 dates/times.

the answer would be 3 days, 12 hours, 0 minutes


--
RawisTheGameHhH
------------------------------------------------------------------------
RawisTheGameHhH's Profile: http://www.excelforum.com/member.php...o&userid=35945
View this thread: http://www.excelforum.com/showthread...hreadid=557337

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MartinW
 
Posts: n/a
Default Need a function that calculates time between 2 dates

Hi Rawis,

In A3 put =A2-A1
And format cell as custom d:hh:mm for 3:12:00 or
dd:hh:mm for 03:12:00

HTH
Martin


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RawisTheGameHhH
 
Posts: n/a
Default Need a function that calculates time between 2 dates


anyway to make it say days after days, hours after hours,etx


--
RawisTheGameHhH
------------------------------------------------------------------------
RawisTheGameHhH's Profile: http://www.excelforum.com/member.php...o&userid=35945
View this thread: http://www.excelforum.com/showthread...hreadid=557337

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RagDyeR
 
Posts: n/a
Default Need a function that calculates time between 2 dates

Check out this link:

http://www.cpearson.com/excel/datedif.htm

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"RawisTheGameHhH"
<RawisTheGameHhH.2a7z4u_1151678434.2285@excelfor um-nospam.com wrote in
message news:RawisTheGameHhH.2a7z4u_1151678434.2285@excelf orum-nospam.com...

I have been playing around with a function that will give me the
difference between to dates and times.

Example:
A1 contains 6/10/06 10:00AM
A2 contains 6/13/06 10:00PM

I am trying to get a function to give me an answer with how many days,
hours and minutes between the 2 dates/times.

the answer would be 3 days, 12 hours, 0 minutes


--
RawisTheGameHhH
------------------------------------------------------------------------
RawisTheGameHhH's Profile:
http://www.excelforum.com/member.php...o&userid=35945
View this thread: http://www.excelforum.com/showthread...hreadid=557337


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Need a function that calculates time between 2 dates

Just subtract one from the other and format as

d "days, " h "hours, " m "mins, " s "secs"

This falls down if more than 31 days are betgween dates though, where you
would need

=INT(A2-1)-INT(A1+1)+(MOD(A2,1)+(1-MOD(A1,1))=1)&" days "&
TEXT(MOD((MOD(A2,1)+(1-MOD(A1,1))),1),"h ""hours, "" m ""mins, "" s
""secs""")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RawisTheGameHhH"
<RawisTheGameHhH.2a7z4u_1151678434.2285@excelfor um-nospam.com wrote in
message news:RawisTheGameHhH.2a7z4u_1151678434.2285@excelf orum-nospam.com...

I have been playing around with a function that will give me the
difference between to dates and times.

Example:
A1 contains 6/10/06 10:00AM
A2 contains 6/13/06 10:00PM

I am trying to get a function to give me an answer with how many days,
hours and minutes between the 2 dates/times.

the answer would be 3 days, 12 hours, 0 minutes


--
RawisTheGameHhH
------------------------------------------------------------------------
RawisTheGameHhH's Profile:

http://www.excelforum.com/member.php...o&userid=35945
View this thread: http://www.excelforum.com/showthread...hreadid=557337





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MartinW
 
Posts: n/a
Default Need a function that calculates time between 2 dates

Re-reading your post also try custom d"days"hh"hours"mm"mins"

HTH
Martin


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RawisTheGameHhH
 
Posts: n/a
Default Need a function that calculates time between 2 dates


MartinW Wrote:
Re-reading your post also try custom d"days"hh"hours"mm"mins"

HTH
Martin

you guys are great! anyway to have it so it wont count the weekends?


--
RawisTheGameHhH
------------------------------------------------------------------------
RawisTheGameHhH's Profile: http://www.excelforum.com/member.php...o&userid=35945
View this thread: http://www.excelforum.com/showthread...hreadid=557337

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Need a function that calculates time between 2 dates


RawisTheGameHhH Wrote:
anyway to have it so it wont count the weekends?


assuming both A1 and A2 are on weekdays

=(NETWORKDAYS(A1,A2)-1)+MOD(A2,1)-MOD(A1,1)

format as before


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=557337

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Need a function that calculates time between 2 dates

Only upto 31 days

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"MartinW" wrote in message
...
Re-reading your post also try custom d"days"hh"hours"mm"mins"

HTH
Martin




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
time sheet drop down lists Steve Excel Discussion (Misc queries) 12 March 18th 06 10:30 PM
Function to calculate the nuber of weeks between dates? Fish Excel Worksheet Functions 4 March 13th 06 10:55 PM
How to create command button to save the dates and time Ken Vo Excel Discussion (Misc queries) 6 January 5th 06 04:18 AM
Hyperlink function without openening new Explorer every time nijunge Excel Worksheet Functions 1 August 25th 05 09:11 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM


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

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"