[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

EOMONTH

Syntax:

EOMONTH ( start-date , month-offset )

Description: Computes the serial value of the last day of the month for the date that is month-offset months from the date specified by the date start-date, taking into account the current date base value.

Arguments:

Name

Type

Description

start-date

number

The start date.

month-offset

number

The number of months before or after start-date, truncated to integer. A positive value yields a future date; a negative value yields a past date; a zero value yields the date start-date.

 

Return Type and Value: number – The serial value of the last day of the month for the date that is month-offset months from the date specified by the date start-date, as a whole number.

However, if

start-date is not a valid date, #NUM! is returned.

start-date plus month-offset yields an invalid date, #NUM! is returned.

[Example: For the 1900 date base system:

EOMONTH(DATE(2006,1,31),5) results in a serial value of 38898
EOMONTH(DATE(2004,2,29),12) results in a serial value of 38411
EOMONTH(DATE(2004,2,28),12) results in a serial value of 38411
EOMONTH(DATE(2004,1,15),-23) results in a serial value of 37315

For the 1904 date base system:

EOMONTH(DATE(2006,1,31),5) results in a serial value of 37436
EOMONTH(DATE(2004,2,29),12) results in a serial value of 36949
EOMONTH(DATE(2004,2,28),12) results in a serial value of 36949
EOMONTH(DATE(2004,1,15),-23) results in a serial value of 35853

end example]