Counting the number of days between dates to exclude leap years

This was an interesting one. So what I did first was create a list of years (starting in 1920 – see cell E3 in the List of years sheet)

Then (with the help of Co-pilot) I created a formula that identified if a year was a leap year or not.  These are the rules for identifying if something is a leap year or not.  The mod() function was used to identify if a year was divisible by 400, 4 or 100.  I created a table of years which identified if something was a leap year or not.

Then I did a formula that pulled in the year of the starting date from the Leap year days calculations ( C5) and the year of the ending date (D5) . I then created a countifs()  function to count the number of  “Y” in the Leap year column which corresponded to the two years.

leap year calculation

You can see the video here.

 

If you found this blog useful, why not give it a share?

Facebook
Twitter
LinkedIn
Pinterest
Reddit
Email
Print

Leave a Reply

Your email address will not be published. Required fields are marked *

thirteen − 3 =