Date Functions‎ > ‎

Count Days

 
Count days
between two dates in A2 and B2:
   
    =B2-A2+1

Count weekdays or workdays days between two dates in A2 and B2:
   
    =NETWORKDAYS(A2,B2)   No holidays excluded
        =NETWORKDAYS(A2,B2,Z1:Z50)   Holidays listed in Z1:Z50 also excluded

Count Mondays between two dates in A2 and B2:
    =SUM(INT(((WEEKDAY(A2-{2})+B2-A2)

Count Mondays and Fridays between two dates in A2 and B2:
    =SUM(INT(((WEEKDAY(A2-{2,6})+B2-A2)

Count days between two dates in A2 and B2 where MWF notation is in C2:
    =SUM(INT(((WEEKDAY(A2 - {1,2,3,4,5,6,7}) + B2 - A2) * (--ISNUMBER(MATCH({"*Su*","*M*","*Tu*","*W*","*Th*","*F*","*Sa*"}, C2, 0)))) / 7))

                                                                                                        Example

 ABCDEFGHI
1StartEndDaysCount   Days 
27/1/20117/14/2011Su/Sa4   Su 
31/1/20112/1/2011W4   M 
41/1/20112/1/2011M/W/F13   Tu 
5       W 
6       Th 
7       F 
8       Sa 
9         


Nothing says "thanks" like a steak dinner!
PayPal - The safer, easier way to pay online!
Comments