Translate

29 December 2013

Count the Mondays this month

To count the number of Mondays in a month in an Excel cell, use the following formula:

=sumproduct(--(weekday(row(indirect((eomonth(today(),-1)+1) & ":" & (eomonth(today(),0)))))=2))

In December 2013, this returns 5.  How do you alter the formula for any day of the week?  Change the 2 at the end of the formula to the number corresponding to the day of the week:
  • Sunday = 1
  • Monday = 2
  • Tuesday = 3
  • Wednesday = 4
  • Thursday = 5
  • Friday = 6
  • Saturday = 7
For example, changing the 2 to 6 would result in the number 4, as there are 4 Saturdays in December 2013.

As always, I welcome your comments.  Click on the Comment link below; it may say "No" or have a number in front of it.

No comments:

Post a Comment

Put comments here.