5g: CountDOWInMonthλ()

Description

CountDOWInMonthλ() counts the number of a specific weekday in a month.

Syntax

CountDOWInMonthλ( Dates, DayOfWeek, [Diagnostics])

The CountDOWInMonthλ function has the following arguments:

Dates
(Required) This is a date for each month. The date may be any date within the month. 

DayOfWeek
(Required) This is the number of day of the week we want to count. Sundays are 1 and Saturdays are 7.

Diagnostics (Optional)
If TRUE, input errors that can occur after formula entry will display as diagnostic messages. The default is FALSE. It is recommended that models have a named range called Diagnostics and this named range be set to TRUE during model development and then set to FALSE when the model is placed into production.

Example

Out client is a manufacturer. Sales have increased beyond their current production capacity. One of the company's options is to run weekends. To get their workforce to work those days requires a 50% pay premium for Saturdays and a 100% premium for Sundays. So the company has asked its FP&A team to determine the net profit impact. This requires knowing how many Saturdays, and how many Sundays are in each month while this situation lasts. 

We are using CountDOWInMonthλ() to determine how many of each weekday are in each month so we can calculate production costs.