#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default autofill date times

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default autofill date times

Argh, forgive me, I gave the wrong formula.

=DATE(YEAR(A1),MONTH(A1),DAY(A1))+TIME(HOUR(A1)+1, 0,0)
--
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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default autofill date times

Time is a fraction of a day. You are getting a rounding error because 1
minute is 1/(24*60) which is a repeating decimal like 1/3 =
..3333333333333333333.

You could use a formula to get better results and then copy and paste value
to remove the formula

Put in cell A1
january 1, 2007 00:00:00
Put in cell A2 and copy down column
=A$1+(ROW()-1)*TIME(1,0,0)



"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.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default autofill date times

Hi Luke:

Thank you for replying to my post. This gives me a good start. However,
there is still a problem. Here is my description of the problem:
1.) type in cell A1 the date January 1, 2008 00:00
2.) Type in cell A2 your formula
=DATE(YEAR(A1),MONTH(A1),DAY(A1))+TIME(HOUR(A1)+1, 0,0)
3.) use autofill to drag down the contents to fill in the 24 hour schedule.
4.) the problem begins on January 2, 2008 00:00. Here the autofill reverts
back to january 1, 2008 00:00. The autofill never advances to january 2nd.

How can I make Excel autofill 365 days in a year with 24 hours in each day?

David in Fort Myers

"Luke M" wrote:

Argh, forgive me, I gave the wrong formula.

=DATE(YEAR(A1),MONTH(A1),DAY(A1))+TIME(HOUR(A1)+1, 0,0)
--
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.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default autofill date times

Don't use autofill. Instead copy A2 down the worksheet.

"David in Fort Myers" wrote:

Hi Luke:

Thank you for replying to my post. This gives me a good start. However,
there is still a problem. Here is my description of the problem:
1.) type in cell A1 the date January 1, 2008 00:00
2.) Type in cell A2 your formula
=DATE(YEAR(A1),MONTH(A1),DAY(A1))+TIME(HOUR(A1)+1, 0,0)
3.) use autofill to drag down the contents to fill in the 24 hour schedule.
4.) the problem begins on January 2, 2008 00:00. Here the autofill reverts
back to january 1, 2008 00:00. The autofill never advances to january 2nd.

How can I make Excel autofill 365 days in a year with 24 hours in each day?

David in Fort Myers

"Luke M" wrote:

Argh, forgive me, I gave the wrong formula.

=DATE(YEAR(A1),MONTH(A1),DAY(A1))+TIME(HOUR(A1)+1, 0,0)
--
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.

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
How do I get the current date to autofill digitalmuse Excel Worksheet Functions 4 October 22nd 08 02:01 AM
Autofill reference formula but repeating n times before incrementi Anton[_2_] Excel Worksheet Functions 4 July 22nd 08 04:22 PM
date & time format and autofill fosnanna Excel Discussion (Misc queries) 1 April 5th 06 01:23 AM
Autofill Date/Time systemx Excel Worksheet Functions 1 December 20th 05 03:36 AM
Autofill date based on date in another cell karstens Excel Worksheet Functions 1 June 1st 05 12:55 AM


All times are GMT +1. The time now is 01:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"