FracinDean
Board Regular
- Joined
- Jul 11, 2011
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
This is a problem I have run into many times over the last 25 or so years (since Excel first came out). When I use a date variable on a chart axis, I often would like to have a fixed multiple of years (1 year, 2 years, etc.) as the major axis interval; however, the number of days varies for any interval that is not 4 years, because of leap year. The exception is during the centennial when there is no leap year. The only way that I know how to do this is to abandon the date variables altogether, and use an integer for the year plus the fraction of the year (YEARFRAC) to calculate the modulus. Then I can make the major interval 1. Does anyone know how to use some sort of date constants to assign the major interval as "one year" even though you are using serial dates on the axis? I'm happy to handle in either VBA or directly in Excel, if you can show me the way. Even if you don't have the answer for this one, thanks to all for reviewing the question, and thanks especially to the MVPs that are often so helpful.