leapyear function

G

Guest

I have a master spreadsheet for one year at a time to calculate auto milleage. On the February page for the last day of the month of the current year it read 3/1. When this spreadsheet is used next year (a leapyear) that cell should read 2/29. Is there an IF formula that will enable me to have the March sheet (Cell B1 for instance, see below) use the information from Feb C33 only when A33 reads 2/29, and from C32 when A33 reads 3/1


A B
Date Begining End of Tri
of Tri

1 | 2/
...
32| 2/28
33| 2/2
 
P

Peo Sjoblom

If your dates are real dates with years you can use this

=IF(DAY(DATE(YEAR(A32),MONTH(A32)+1,0))=29,C33,C32)

and in A33 this formula

=IF(DAY(DATE(YEAR(A32),MONTH(A32)+1,0))=29,DATE(YEAR(A32),MONTH(A32)+1,0),""
)

that will only return a 02/29 if there is a leap year, otherwise it will be
blank

If you just want to check A33 and it's either mar 1 or feb 29

use

=IF(DAY(A33)=1,C32,C33)

--

Regards,

Peo Sjoblom


Michael said:
I have a master spreadsheet for one year at a time to calculate auto
milleage. On the February page for the last day of the month of the current
year it read 3/1. When this spreadsheet is used next year (a leapyear) that
cell should read 2/29. Is there an IF formula that will enable me to have
the March sheet (Cell B1 for instance, see below) use the information from
Feb C33 only when A33 reads 2/29, and from C32 when A33 reads 3/1?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top