LAMBDA · Date and time

Quarter end LAMBDA

xl.quarter.end returns the last calendar day of the quarter. July 4, 2026 is in the third quarter, which ends on September 30, 2026.

Microsoft 365, Excel 2024, and Excel for the web. Excel 2021 does not have LAMBDA.

Syntax =xl.quarter.end(day)

xl.quarter.end
=LAMBDA(day,
  LET(
    shift, MOD(3 - MOD(MONTH(day), 3), 3),
    EOMONTH(day, shift)
  )
)

Arguments

NameRequiredWhat to pass
dayRequiredAny date. The year of that date is the year of the quarter. This is a calendar quarter, not a fiscal quarter that starts in another month.

Examples

Independence Day 2026

=xl.quarter.end(DATE(2026,7,4))

Result September 30, 2026

=EOMONTH(B1,MOD(3-MOD(MONTH(B1),3),3))B2
Quarter
AB
1Date7/4/2026
2Quarter end9/30/2026
A picture of the sheet, not a live calculator.

xl.quarter.end snaps a date to the last day of its calendar quarter. July 4, 2026 is in July, August, and September, so the result is September 30, 2026. March 31 stays March 31. January 15 becomes March 31. December 1 becomes December 31.

A fiscal year that starts in February, July, or October is a different calendar. This function does not take a fiscal start month.

Add it to the workbook

Copy the formula in the block above, including the line breaks. Choose Formulas, Name Manager, New. Set the name to xl.quarter.end, the scope to Workbook, and paste into Refers to. Excel Labs can do the same step: open the Advanced Formula Environment, add that name, and save it back to the workbook. A cell then calls =xl.quarter.end(...).

The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA even when it already has XLOOKUP, FILTER, or LET.

How it works

MOD(MONTH(day), 3) is 1 for January, April, July, and October. Those months need two more months to reach the quarter end. February, May, August, and November need one. March, June, September, and December need zero. EOMONTH of the original date plus that shift is the last day of the landing month. July is month 7. MOD(7, 3) is 1, the shift is 2, and two months after July 4 is September 4, whose month-end is September 30.

Limits

The quarter is January–March, April–June, July–September, and October–December. Format the result as a date. The serial underneath is September 30, 2026.