View Single Post
  #3   Report Post  
Dave O
 
Posts: n/a
Default

I mocked up some sample data: pay period start date in column A, end
date in column B. When A2 and B2 are populated, the formula in C2 is
=IF(MONTH(A3)<MONTH(B3),"Days in " & TEXT(A3,"mmmm") &": " &
EOMONTH(A3,0)-A3+1 & "; Days in " & TEXT(B3,"mmmm") &":
"&B3-EOMONTH(B3,-1),"Days in " & TEXT(A3,"mmmm") &": " & B3-A3+1)

This will determine the number of days in a single month or in both
months when the pay period spans 2 months.