To calculate the exact number of days between two dates, you can use the following formula:
=ROUNDUP((A2-A1) *+ DAYS(DATE(YEAR(A2),MONTH(A2),1), DATE(YEAR(A2),MONTH(A2)+1,1)),0)
Summary:
A2-A1
calculates the exact number of days between the two dates.DAYS(DATE(YEAR(A2),MONTH(A2),1),DATE(YEAR(A2),MONTH(A2)+1,1))
calculates the number of days in the month of the second date.- Multiplying the difference in days by the number of days in the month of the second date gives the exact number of days between the two dates.
ROUNDUP
is used to round up the result to the nearest whole number.
This formula should work regardless of whether the number of months is recorded with decimals or not.