ENDOFMONTH

Returns the end date of the month for the date passed to the function.  The time returned is 11:59:59 PM.

Syntax

= ENDOFMONTH(valueDate)

Parameters

valueDate

A date time value whose end date of the month is to be determined. The value can contain DateTime as a string (e.g. “02/19/2009 14:30:30.3”, "2009-02-19 14:30:30.3", "19 Feb 2009 2:30:30.3 PM ", "Thu, 19 Feb 2009”) or as a DateTime object.

Return Type

DateTime. The function returns a Microsoft .NET DateTime object.  Any properties or member functions of the DateTime object can also be accessed or used in formulas.

Examples

Example

Returns

= ENDOFMONTH(“2/2/2010”)

2/28/2010 11:59:59 PM

= ENDOFMONTH(“2/2/2010”).MONTH

The month extracted from end of the month.

= ENDOFMONTH(“2/2/2010”).ADDDAYS(1)

The end date of the month next to the date passed to the function.

= STARTOFMONTH(“2/2/2010”).ADDDAYS(1).MONTH

The value of the month next to the date passed to the function.

Reference

http://msdn.microsoft.com/en-us/library/system.datetime_members(VS.71).aspx