=NETWORKDAYS(A1,A2)
NOTE: The dates in A1 and A2 must be weekdays, or the result may not be correct.
NOTE: the NETWORKDAYS() function is included in the Microsoft Excel Analysis Toolpack Add-In.
This function is designed to exclude Saturday and Sunday as the weekend. In all versions of Microsoft Excel including version 4.0 the following formula can be used to find the number of weekdays between two dates, where Thursday and Friday are the weekend:
=A2-A1+1-INT((A2-A1)/7)*2-IF(AND(WEEKDAY(A2)<>7,WEEKDAY(A1)<>7,WEEKDAY(A2)<WEEKDAY(A1),WEEKDAY(A1)<>6),2,IF(AND(WEEKDAY(A2)=7,WEEKDAY(A1)<=5),2,IF(AND(WEEKDAY(A2)=6,WEEKDAY(A1)<=5),2,IF(OR(WEEKDAY(A1)=6,WEEKDAY(A2)=5),1,IF(AND(WEEKDAY(A1)=7,WEEKDAY(A2)=6),2,0)))))-IF(AND(WEEKDAY(A1)=6,WEEKDAY(A2)=5),1,0)