#1   Report Post  
tiw
 
Posts: n/a
Default leap year question

Hi,
I have a column for dates, starting with the first day of the year. I only
have to input the first day on cell A@ (say 01/01/06) and the all the days of
the years will be display in the same column (I wrote the simple formula
=A2+1). Now the next leap year is 2008 and i don't want to have to copy the
last row to add the extra day, I want excel to display the last row of the
date column if it's a leap year and not to display it when is not. What
should I do? Thank you
Thalia
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

use a formula in A2 of

=A1+(YEAR(A1+1)=YEAR(A1)

and copy down to A366


or even just put =IF(YEAR(A365+1)=YEAR(A365),A365+1,"") in A366

--

HTH

RP
(remove nothere from the email address if mailing direct)


"tiw" wrote in message
...
Hi,
I have a column for dates, starting with the first day of the year. I only
have to input the first day on cell A@ (say 01/01/06) and the all the days

of
the years will be display in the same column (I wrote the simple formula
=A2+1). Now the next leap year is 2008 and i don't want to have to copy

the
last row to add the extra day, I want excel to display the last row of the
date column if it's a leap year and not to display it when is not. What
should I do? Thank you
Thalia



  #3   Report Post  
Niek Otten
 
Posts: n/a
Default

Hi Thalia,

With one exception (1900) Excel knows exactly which years are leap years. If
you just add 1 day, it will skip from Feb 28 to Mar 1 on one year, and to
Feb 29 in another.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"tiw" wrote in message
...
Hi,
I have a column for dates, starting with the first day of the year. I only
have to input the first day on cell A@ (say 01/01/06) and the all the days
of
the years will be display in the same column (I wrote the simple formula
=A2+1). Now the next leap year is 2008 and i don't want to have to copy
the
last row to add the extra day, I want excel to display the last row of the
date column if it's a leap year and not to display it when is not. What
should I do? Thank you
Thalia



  #4   Report Post  
tiw
 
Posts: n/a
Default

Hi Niek,
I know that, My issue is that I have a whole year of dates from Jan 1st to
Dec 31, and on a leap year I would have one extra day. in cell A2 I input
the first day of the year say 01/01/05 and in the cell below I wrote the
formula =A2+1 and carried that formula down to get all the cells I need for
the year. On 2008 I will need an extra cell in the end for the extra year
wich will display 12/01/08 but in other years if I leave that cell it will
display the first day of the next year and I don't want it to be displayed
unless it's a leap year.
Thalia

"Niek Otten" wrote:

Hi Thalia,

With one exception (1900) Excel knows exactly which years are leap years. If
you just add 1 day, it will skip from Feb 28 to Mar 1 on one year, and to
Feb 29 in another.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"tiw" wrote in message
...
Hi,
I have a column for dates, starting with the first day of the year. I only
have to input the first day on cell A@ (say 01/01/06) and the all the days
of
the years will be display in the same column (I wrote the simple formula
=A2+1). Now the next leap year is 2008 and i don't want to have to copy
the
last row to add the extra day, I want excel to display the last row of the
date column if it's a leap year and not to display it when is not. What
should I do? Thank you
Thalia




  #5   Report Post  
tiw
 
Posts: n/a
Default

Hi Bob,
Thank you, I used the second formula and it works, I tried the first one and
I don't know why it didn't work.
Thalia

"Bob Phillips" wrote:

use a formula in A2 of

=A1+(YEAR(A1+1)=YEAR(A1)

and copy down to A366


or even just put =IF(YEAR(A365+1)=YEAR(A365),A365+1,"") in A366

--

HTH

RP
(remove nothere from the email address if mailing direct)


"tiw" wrote in message
...
Hi,
I have a column for dates, starting with the first day of the year. I only
have to input the first day on cell A@ (say 01/01/06) and the all the days

of
the years will be display in the same column (I wrote the simple formula
=A2+1). Now the next leap year is 2008 and i don't want to have to copy

the
last row to add the extra day, I want excel to display the last row of the
date column if it's a leap year and not to display it when is not. What
should I do? Thank you
Thalia






  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

see my response

--

HTH

RP
(remove nothere from the email address if mailing direct)


"tiw" wrote in message
...
Hi Niek,
I know that, My issue is that I have a whole year of dates from Jan 1st to
Dec 31, and on a leap year I would have one extra day. in cell A2 I input
the first day of the year say 01/01/05 and in the cell below I wrote the
formula =A2+1 and carried that formula down to get all the cells I need

for
the year. On 2008 I will need an extra cell in the end for the extra year
wich will display 12/01/08 but in other years if I leave that cell it will
display the first day of the next year and I don't want it to be displayed
unless it's a leap year.
Thalia

"Niek Otten" wrote:

Hi Thalia,

With one exception (1900) Excel knows exactly which years are leap

years. If
you just add 1 day, it will skip from Feb 28 to Mar 1 on one year, and

to
Feb 29 in another.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"tiw" wrote in message
...
Hi,
I have a column for dates, starting with the first day of the year. I

only
have to input the first day on cell A@ (say 01/01/06) and the all the

days
of
the years will be display in the same column (I wrote the simple

formula
=A2+1). Now the next leap year is 2008 and i don't want to have to

copy
the
last row to add the extra day, I want excel to display the last row of

the
date column if it's a leap year and not to display it when is not.

What
should I do? Thank you
Thalia






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
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
Month Year Date Format Jamie Excel Worksheet Functions 2 February 7th 05 06:43 PM
Need totals of values that fall within a given year Pierre Excel Worksheet Functions 12 January 5th 05 04:45 PM
Weeknum Year by Year Compare RJB Charts and Charting in Excel 4 December 29th 04 10:33 PM
Another question regarding Dates.. Anthony Slater Excel Discussion (Misc queries) 2 December 20th 04 03:31 PM


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