Count Days between Two Dates within Specific Dates

I'm not sure if the title makes much sense, but where is what I've been trying to lookup documentation or help for. 

I have two columns with dates, [Start Date] and [End Date] for Leave of Absences.
I need to count the number of days within the 1st of the Month to the 16th. 

For example:
If the [Start Date] is January 28th and the [End Date] is February 5th, the total days would be equal to 5.
If the [Start Date] was February 8th and the [End Date] was February 14th, the total days would be equal to 7.

If anyone could help, or point me in the right direction I'd appreciate it.

0 2 99
2 REPLIES 2

To start with you can create two more columns (or Virtual Columns) to convert the start date and end date based on the criteria i.e. to fall within 1st and 16th of the month

jyothis_m_0-1693463555361.png

Formula for LEAVE START =IF(DAY(A2)>16,EOMONTH(A2,0)+1,A2)

Formula for LEAVE END =IF(DAY(B2)>16,DATE(YEAR(A2),MONTH(A2),16),B2)

Formula for LEAVE DAYS =IF(D2-C2+1<0,0,D2-C2+1)

 

but i guess your requirement is more complex than mentioned in your example. You will have to tweak the formulas accordingly

Top Labels in this Space