Thursday, 19 May 2016

    How to count the number of Saturdays/Sundays between two dates (you can count the number of weekdays between two dates like Monday, Tuesday, Wednesday, Thursday, Friday).

   For example, I have Start date (A1 cell) and End date (A2 cell), I can count the number of weekends/weekdays between two dates as follows:
 
 
  - Count number of Sundays between two dates:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=1,1,0))
    Press Ctrl + Shift + Enter keys to run array formula.

  - Count number of Saturdays between two dates:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=7,1,0))
    Press Ctrl + Shift + Enter keys to run array formula.

  - Similarly, you can count the number of weekdays between two dates like Monday, Tuesday, Wednesday, Thursday, Friday:

    Monday:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=2,1,0))
    Tuesday:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=3,1,0))
   Wednesday:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=4,1,0))
   Thursday:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=5,1,0))
   Friday:
=SUM(IF(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=6,1,0))
    Please share this post, thanks!

0 comments:

Post a Comment