Translate

Showing posts with label excel at Excel. Show all posts
Showing posts with label excel at Excel. Show all posts

29 December 2013

Count the Mondays next month

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

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

In December 2013, this returns 4 because there are 4 Mondays in January 2014.  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 in December 2013 would result in the number 5, as there are 5 Saturdays in January 2014.

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

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.

Name of next month

To display the name of the next month in an Excel cell, use the following formula:

=text(now()+day(now()),"mmmm")

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

Add text after a formula

To add more text to a formula result in an Excel cell, put an ampersand (&) outside the end of the formula, then put a quotation mark (").  Type in your additional text, then close with another quotation mark (").  For example:

=text(now()-day(now()),"mmmm")&" paycheck"

This will returned the name of the month followed by the word paycheck.  In December, it returned December paycheck.  Note that there is a space after the first quotation mark.  That is so there is a space between my result and my text.  Without it, I would get Decemberpaycheck.

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

Name of previous month

To display the name of the previous month in an Excel cell, use the following formula:

=text(now()-day(now()),"mmmm")

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

Name of the current month

To display the name of the current month in an Excel cell, use the following formula:

=text(now(),"mmmm")

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