View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default autofill date times

Explaination:
Time is stored as a decimal in XL.(time is a fraction of a day) Note that if
you formatted your cells to general, you would see this. When XL Autofills,
it's actually just creating the same delta between numbers. Unforutnately, 1
hr is ~ 0.0416666667
Like any computer, there's a limit to how many decimals it can store, while
humans realize the 6 should repeat forever. After enough cells, that odd
decimal throws things off, thus giving you the 59 minutes.

Solution:
After inputting date in first cell, next row use formula:
=A2+TIME(1,0,0)

Now you're specifically telling XL to always add 1 hr, as opposed to some
decimal.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"David in Fort Myers" wrote:

Hi:

I am working on creating a shift schedule for paramedics and firemen. They
are on a 24-hour schedule and the shifts rotate around. The first step is to
have all 365 days in a year with each day having 24 hours. In Excel 2003, I
type into the first three cells;
january 1, 2007 00:00:00
january 1, 2007 01:00:00
january 1, 2007 02:00:00
January 1, 2007 03:00:00
January 1, 2007 04:00:00

I highlight these cells and use autofill to fill in the rest of the year
with my 24-hour schedule. Excel understands what I am doing and it begins
incrementing by one hour. Unfortunately, I don't get far. At about january 5,
2007 I notice the date/time stamp starts to look like;
january 5, 2007 07:59:00
january 5, 2007 08:59:00
january 5, 2007 09:59:00
Why does it offset by one minute?
Can anyone tell me how to do this right?
Or alternatively, can anyone recommend a quick fix for what Excel is doing.