Thread: Date arithmetic
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Date arithmetic

Hi,

Dates in Excel are numbers. Today for example (31/12/2008) is 39813 and
these are then formatted to display in whatever way a user wants to see them.

So to your first question the difference between 2 dates is simply subtraction

Later date - earlier date and format as general

There are inbuilt date functions including the undocumented datedif
function, have a look here.

You don't have to 'convert' dates to do date arithmatic.

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

With regard to adding dates I'm sure someone must want to do it but I'm at a
bit of a loss to understand why anyone would want to. In practical terms it's
more useful to add number of days to a date and this again uses +.

Excel also has some other inbuilt date functions such as networkdays, and if
you search 'Dates' in Excel help you'll find lots.

Mike

"Terry Pinnell" wrote:

It's been a long time since I did any subtractions of dates, and would
much appreciate a little help please. In particular, what is the
simplest way of finding the period that's elapsed bewteen two
date/times? Of course, I would want to display it in the most common
sense format, across a wide range. Must I convert each date first,
subtract and then convert back, or can it be done in one formula?

Is there ever any practical application for *adding* two date/time
values?

--
Terry, East Grinstead, UK