View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chrissy[_4_] Chrissy[_4_] is offline
external usenet poster
 
Posts: 101
Default periods of time in excel

Excel stored date/time values as the number of days
and the fraction of a day past a start date. You do not
have to worry about what day is the start date.

If you put a date in A1 and this formula in another
cell

= A1 + 1

that cell will have a date one day later than A1.

The day is divided into fractions based on the time. If you
use have a time in cell A1 and this formula in anther cell

= A1 + 0.5

you will have a time 12 hours after the time in A1.

You can format any positive number (integer or not and integer)
as a date, as a time or as a date/time. The fractional part will be
the time and the integer part will be the date.

You can do many numeric things with dates

= A2 - A1

will give the number of days between A1 and A2 if A1 is earlier than
A2.

If those cells have fractional parts then you get the number of days
difference and any fractional part is the time difference. If you multiply
the difference by 24 you get the number of hours difference and if you
multiply that number by 60 you get the number of minutes.

let A1 contain 123
let B1 contain 234

C1 = B1 - A1

it will contain 111

Change the format of A1 and B2 to display a date and you can use it as
the number of days between those two dates.

let A1 contain 123.25
let B1 contain 123.75

C1 = (B1 - A1) * 24

it will contain 12 and can be used as the number of hours between those
two date/time values.

Basically, integers are dates and fractions are time and you can do numerical
things to them.

For things like total hours worked you need 1.5 to represent 36 hours and not
1 1/2 days. If you format something as time and add 1 to it you get the same
time the next day. To show a number greater than 1 as 24+ hours you format
it with "[]" around the h or hh in the time format.

Hope this helps.

Chrissy.



"orlando barreto" wrote in message ...
Some advice will be appreciate for the following:
Are there any way to calculate in Excel the HOURS and
MINUTES elapsed between any time-any day and "other"
any time-any day, let's say between 10/23/2003 & 11/23/
2003 or 10/23/2002 & 11/23/2003.

Any explanation will be greatly appreciate

Orlando Barreto
Mechanioal Engineer