I am trying to put a formula where i can find out the count of leap years between 2 given dates. for example
A2 - 09/10/2014
C23 - 09/10/2020
Formula which I am using is - DATE(YEAR(C23),1,1)-DATE(YEAR(A2),1,1)-((YEAR(C23)-YEAR(A2))*365)+AND(MONTH(DATE(YEAR(A2),2,29))=2,MONTH(DATE(YEAR(C23),2,29))=2)*1
As of now the result is coming is 1 but there are two leap years between these 2 dates i.e. 2016 & 2020. I don't understood where is the formula going wrong.
A2 - 09/10/2014
C23 - 09/10/2020
Formula which I am using is - DATE(YEAR(C23),1,1)-DATE(YEAR(A2),1,1)-((YEAR(C23)-YEAR(A2))*365)+AND(MONTH(DATE(YEAR(A2),2,29))=2,MONTH(DATE(YEAR(C23),2,29))=2)*1
As of now the result is coming is 1 but there are two leap years between these 2 dates i.e. 2016 & 2020. I don't understood where is the formula going wrong.