Hi friends,
I am trying to find how many leap days (February 29) between two dates.
The result has to be a number that I will use in another calculation.
Could you please help.
Thank you,
Claudia
Hi friends,
I am trying to find how many leap days (February 29) between two dates.
The result has to be a number that I will use in another calculation.
Could you please help.
Thank you,
Claudia
If lower date is in A1 and Second date is in B1 then Maybe
=INT((YEAR(B1)-1920)/4)-INT((YEAR(A1)-1920)/4)+IF(AND(MOD(2020,4)=0,B1>=B1),1,0)
Last edited by mehmetcik; 03-05-2020 at 07:28 PM.
My General Rules if you want my help. Not aimed at any person in particular:
1. Please Make Requests not demands, none of us get paid here.
2. Check back on your post regularly. I will not return to a post after 4 days.
If it is not important to you then it definitely is not important to me.
Hi mehmetcik,
thanks a lot for your help, but I have just tried it between 9-Jan-2012 10-Jan-2016 and it gave 2 days.
Please let me know how to fix.
Thanks again![]()
Try:
![]()
Please Login or Register to view this content.
Quang PT
Hi, forget my solution in #4, it does not work with 2 date in same year.
Try below:
![]()
Please Login or Register to view this content.
Sorry Error crept in while I was testing
=INT((YEAR(B1)-1920)/4)-INT((YEAR(A1)-1920)/4)+IF(AND(MOD(YEAR(B1),4)=0,B1>=DATEVALUE("29/02/" &YEAR(B1))),1,0)
Withdrawn by FR.
Didn't work.
Last edited by FlameRetired; 03-06-2020 at 12:00 AM.
Dave
=SUMPRODUCT((MOD(YEAR(ROW(INDIRECT(A1&":"&A2))),4)=0)*(DAY(ROW(INDIRECT(A1&":"&A2)))=29)*(MONTH(ROW(INDIRECT(A1&":"&A2)))=2))
expanding the logic for how many Mondays https://exceljet.net/formula/count-d...-between-dates
post 5 is a better answer
Last edited by davsth; 03-06-2020 at 05:32 AM.
The INDIRECT function is Volatile so if the OP needs to use this formula in a large amount of cells, then maybe this non-Volatile version of your formula would work better for such a case...
Formula:
Please Login or Register to view this content.
Last edited by Rick Rothstein; 03-06-2020 at 08:27 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks