For the complete documentation index, see llms.txt. This page is also available as Markdown.

Specific time periods

Plan supports specific time period functions that retrieve data for individual months, quarters, or years. These functions help you select data for a single time period or a range of time periods for analysis and reporting.

MONTHPERIOD

The MONTHPERIOD function returns a range of dates for a specified month or range of months within a given year. Use this function with the SELECT.BYDATE function and an aggregate function, such as SUM or AVERAGE, to retrieve and aggregate data over the returned date range.

Syntax

MONTHPERIOD(year, from_month, [to_month])

Arguments

  • year: The year for which data is returned.

  • from_month: Specifies the month for which data is returned or the starting month of the range. Valid values are 1 through 12.

  • to_month (optional): Specifies the ending month of the range. Valid values are 1 through 12.

Return value

Returns a range of dates for the specified month or range of months.

Examples

MONTHPERIOD(2025,1,7)

Returns the date range from January to July of 2025.

Returns the date range for April 2025.

QTRPERIOD

The QTRPERIOD function returns a range of dates for a specified quarter or range of quarters in a given year. Use this function with the SELECT.BYDATE function and an aggregate function, such as SUM or AVERAGE, to retrieve and aggregate data over the returned date range.

Syntax

Arguments

  • year: The year for which data is returned.

  • from_quarter: The quarter to return, or the starting quarter when specifying a range. Valid values are 1 through 4.

  • to_quarter (optional): The ending quarter of the range. Valid values are 1 through 4.

Return value

Returns a range of dates for the specified quarter or range of quarters.

Examples

Returns the date range from the first quarter through the third quarter of 2025.

Returns the date range for the fourth quarter of 2025.

YEARPERIOD

The YEARPERIOD function returns a range of dates for a specified year or range of years. Use this function with the SELECT.BYDATE function and an aggregate function, such as SUM or AVERAGE, to retrieve and aggregate data over the returned date range.

Syntax

Arguments

  • from_year: The year to return, or the starting year when specifying a range.

  • to_year (optional): The ending year of the range.

Return value

Returns a range of dates for the specified year or range of years.

Examples

Returns the date range from 2024 through 2026.

Returns the date range for 2025.

Last updated

Was this helpful?