LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default Adding dates and times

You could change the base date to 1904--but that will mess up your dates.

You could try tools|options|calculation tab|check "1904 date system"--but be
prepared to toggle it back after you see what it does with your dates.

The actual subtraction works fine--but the display will show ####'s.

So one way around it is to use two cells--one for the calculated value:
=a1-a2
(say in A3)
(hide this if you want)
Then use another cell A4(?) to show the results:

=IF(A3<0,"-","")&TEXT(ABS(A3),"[hh]:mm")

This cell is text, though--so use that intermediate cell if you need to do
further calculations.





DejaVu wrote:

Thanks Dave Peterson and Sloth -
That was exactly what I was looking for. I tried this several times,
but I could not get the hours to add days. I had my cell formatted as
*hh:mm*, and it wouldnt work. I changed it to *[hh]:mm* and it worked
perfectly!

One more question: What will happen if I end up with a negative time?
Say, for example, I have this:
A1: 10/16/05 17:55
A2: 10/15/05 11:30
A3: A2 - A1 = _____?_____

Thanks again,
DejaVu

--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=479280


--

Dave Peterson


 
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
How do I calculate duration between two dates and times in excel? Robin CSM002 Excel Discussion (Misc queries) 3 May 13th 23 07:42 PM
Autoformat dates and times a_ryan1972 Excel Discussion (Misc queries) 5 August 1st 05 10:52 PM
Dates and times with PST,PDT oilers Excel Worksheet Functions 1 July 21st 05 09:50 PM
merge dates and times into one column? Jack Excel Discussion (Misc queries) 2 April 13th 05 05:38 PM
Formula to calculate elapsed time between certain dates and times Stadinx Excel Discussion (Misc queries) 6 March 25th 05 07:02 AM


All times are GMT +1. The time now is 04:32 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"