ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   leap-year condition (https://www.excelbanter.com/excel-programming/284789-leap-year-condition.html)

Michael[_20_]

leap-year condition
 
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/29

Dick Kusleika[_3_]

leap-year condition
 
Michael

=IF(MONTH(Feb!A33)=2,Feb!C33,Feb!C32)

Assumes your sheet for Feb is named "Feb"

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Michael" wrote in message
...
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 C
Date Begining End of Trip
of Trip

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




Michael[_20_]

leap-year condition
 
Thank you very much, I will try it out.


All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com