Tabellab

Month Keys with EOMONTH: Group Any Date into Its Month

Lesson 1 of 20Lab

All lessons
  1. Month Keys with EOMONTH: Group Any Date into Its MonthLabFree
  2. Month-to-Date (MTD): SUMIFS Between the Month Start and the Report DateLab Locked
  3. Year-to-Date (YTD) and Prior-Year YTD with SUMIFS and EDATELab Locked
  4. Year-over-Year (YoY): Variance, Growth % and the "New" CaseLab Locked
  5. Rolling 12 Months: Moving Totals, Averages and a Trend ChartLab Locked
  6. Fiscal Years Starting in April: FY, Fiscal Quarter and Fiscal YTDLab Locked
  7. Like-for-Like (Same-Store) Growth with COUNTIFS FlagsLab Locked
  8. Mid-Course Project: KPI Tiles (Month, YTD, YoY, R12) and a Current vs Prior Year ChartLab Locked
  9. Quarter-to-Date (QTD): Quarter Start, QTD Sales and Prior-Year QTDLab Locked
  10. Running YTD That Restarts Every January, and a Cumulative Year ChartLab Locked
  11. Fair Month Comparisons: Open Days, Sales per Day and Calendar EffectsLab Locked
  12. Actual vs Budget: YTD Budget, Variance % and the Pace Still NeededLab Locked
  13. Full-Year Outlook: Run-Rate, Prior-Year Pattern and Remaining BudgetLab Locked
  14. Month-over-Month vs Rolling 3 Months: Reading Short-Term Trends Without Seasonal NoiseLab Locked
  15. YTD by Channel: Growth Rates vs Contribution to Total GrowthLab Locked
  16. Check the Data Before You Report: Duplicate and Missing Months, Ledger ReconciliationLab Locked
  17. Seasonality in Numbers: Seasonal Index, Share of Year and a Seasonal EstimateLab Locked
  18. One Selector for Month, QTD, YTD and R12: Period Start with IFSLab Locked
  19. YTD Ratio KPIs: Orders, Average Order Value and a Volume vs Price SplitLab Locked
  20. Final Project: Time-Intelligence Dashboard for the Online ChannelLab Locked

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — €9.90
Loading the spreadsheet…

Why every time report starts with a month key

Month-to-date, year-to-date, year-over-year, rolling twelve months: these are the comparisons every management report, board pack and sales review is built on. Power BI and other BI tools call them "time intelligence" and ship special functions for them. In Excel you can build all of them with a few plain formulas, as long as you get one thing right first: a clean way to say which month a date belongs to.

This lesson is for controllers, analysts, small-business owners and anyone who turns a list of dated transactions into monthly numbers. Perhaps you export orders from a web shop, receipts from a till system or invoices from accounting software, and every month you filter by date, copy totals by hand and hope nothing was missed. Here you learn the foundation that removes that work: a month key built with EOMONTH, and monthly totals with SUMIFS and COUNTIFS.

Our example business is Larkspur Coffee Co., a fictional coffee roaster with cafés, an online shop and wholesale customers. Its order list holds a date, a channel and an amount for each order between June and mid-September 2026. The owner wants to see sales and the number of orders per month, and later MTD, YTD and year-over-year figures. All of that starts here.

The core concept: dates are numbers, months are ranges

Excel stores every date as a whole number: the count of days since the start of its calendar. 3 June 2026 is stored as 46176, 30 June 2026 as 46203. The date format only changes how that number is displayed. This matters because it means a "month" is not a label in Excel. It is a range of numbers: June 2026 is every number from 46174 (1 June) to 46203 (30 June).

To group dates by month you can therefore do one of two things. You can give each date a key that is identical for every day of the month and then match on that key. Or you can describe the month by its two bounds, the first and the last day, and count everything in between. This lesson teaches both, because the rest of the course uses both.

EOMONTH(start_date, months) stands for "end of month". It takes a date, moves it by a number of whole months and returns the last day of that month. With 0 months it returns the end of the date's own month: 3 June, 11 June and 27 June all become 30 June 2026. That is the perfect month key. It is the same for every day of the month, it is still a real date that sorts correctly, and you can add months to it or compare it with < and >.

With −1 months, EOMONTH returns the end of the previous month. Add one day and you have the month start: =EOMONTH(A2,-1)+1. So month start and month key are the two bounds of every month window, and both come from the same function. Later in the course, the same pattern gives you the start of the year, the same month last year and a window of twelve months.

Every date maps to one month keyJune 2026start 1 Junkey 30 JunJuly 2026start 1 Julkey 31 JulAugust 2026start 1 Augkey 31 AugSeptember 2026start 1 Sepkey 30 Sep31119272916241614222941015Month start = EOMONTH(date,-1)+1Month key = EOMONTH(date,0)Dots are order dates (day of month below each dot).
The order dates from the lab on a timeline. Each coloured band is one month, from its start (EOMONTH(date,-1)+1) to its key (EOMONTH(date,0)); every dot inside a band gets the same key.

Worked example: Larkspur's orders by month

Here is the lab data with both helper columns already filled in. Column D holds the month key, column E the month start. All amounts are example figures.

Larkspur Coffee Co., orders in A2:C17 with the two helper columns (example figures)
Order date (A)Channel (B)Amount (C)Month key (D)Month start (E)
3 Jun 2026Wholesale1,840.0030 Jun 20261 Jun 2026
11 Jun 2026Online264.5030 Jun 20261 Jun 2026
19 Jun 2026Catering935.0030 Jun 20261 Jun 2026
27 Jun 2026Online412.8030 Jun 20261 Jun 2026
2 Jul 2026Wholesale2,210.0031 Jul 20261 Jul 2026
9 Jul 2026Catering1,180.0031 Jul 20261 Jul 2026
16 Jul 2026Online318.4031 Jul 20261 Jul 2026
24 Jul 2026Wholesale1,675.0031 Jul 20261 Jul 2026
1 Aug 2026Online289.9031 Aug 20261 Aug 2026
6 Aug 2026Catering1,420.0031 Aug 20261 Aug 2026
14 Aug 2026Wholesale1,960.0031 Aug 20261 Aug 2026
22 Aug 2026Online506.2031 Aug 20261 Aug 2026
29 Aug 2026Catering760.0031 Aug 20261 Aug 2026
4 Sep 2026Wholesale2,045.0030 Sep 20261 Sep 2026
10 Sep 2026Online371.6030 Sep 20261 Sep 2026
15 Sep 2026Catering1,290.0030 Sep 20261 Sep 2026

Look at the four June orders (3, 11, 19 and 27 June). Their dates differ, but their month key is the same: 30 Jun 2026. That single shared value is what SUMIFS needs. Notice also the order of 1 August: its month start is 1 August itself, and its key is 31 August. EOMONTH handles months of 30 and 31 days, February and leap years without any extra logic from you.

With the keys in place, the monthly summary is one formula per row. The month keys in A20:A23 are the four month ends, and =SUMIFS($C$2:$C$17,$D$2:$D$17,A20) adds every amount whose key equals the key in A20. The orders are counted the second way, without a helper column, by giving COUNTIFS two conditions on the order date: on or after the month start and on or before the month end.

Monthly summary in A19:C23
Month key (A)Sales (B)Orders (C)Note
30 Jun 20263,452.304
31 Jul 20265,383.404
31 Aug 20264,936.105
30 Sep 20263,706.603list ends 15 Sep: partial month
Total17,478.4016

The four monthly totals add up to 17,478.40, the sum of all sixteen orders, which is the check you should always make: nothing may fall between two months or be counted twice. Notice too that September looks weak. It is not; the list simply ends on 15 September, so September holds only half a month. Comparing a part month with full months is one of the most common errors in monthly reporting, and it is exactly what the month-to-date lesson that follows solves.

Sales per month key (SUMIFS on column D)02,0004,0006,0003,452.304 orderskey 30 Jun5,383.404 orderskey 31 Jul4,936.105 orderskey 31 Aug3,706.603 orderskey 30 SepSeptember (peach) holds data only up to 15 Sep, so it is not a full month yet.
Monthly sales from the summary block. July is the strongest full month; September (peach) is incomplete because the data ends on 15 September.

Here are the formulas of the lab in one place, with the result each one returns for the cell the Coach checks.

The formulas of this lesson
CellFormulaResultWhat it does
D7=EOMONTH(A7,0)31 Jul 2026Month key: last day of the order's month (order of 9 Jul)
E11=EOMONTH(A11,-1)+11 Aug 2026Month start: day after the previous month end (order of 6 Aug)
B22=SUMIFS($C$2:$C$17,$D$2:$D$17,A22)4,936.10August sales, matched on the month keys
C21=COUNTIFS($A$2:$A$17,">="&EOMONTH(A21,-1)+1,$A$2:$A$17,"<="&A21)4July orders, counted between two date bounds

The COUNTIFS criterion ">="&EOMONTH(A21,-1)+1 deserves a closer look. COUNTIFS expects a criterion as text, such as ">=46204". The ampersand joins the text ">=" with the number that EOMONTH returns, so the criterion becomes exactly that. You will use this pattern for every window in the course: MTD, YTD, prior-year YTD and rolling twelve months are all "on or after one date and on or before another".

Which month key should you use?

There are several ways to turn a date into a month. They look similar in a small sheet but behave very differently once a report spans more than one year.

Five ways to turn a date into a month
Key formulaExample result for 9 Jul 2026Real date?Keeps the year?Good for
=EOMONTH(A2,0)31 Jul 2026YesYesMonth keys, windows, EDATE shifts (this course)
=EOMONTH(A2,-1)+11 Jul 2026YesYesMonth starts, lower bounds of windows
=DATE(YEAR(A2),MONTH(A2),1)1 Jul 2026YesYesSame as above, easier to read for some
=TEXT(A2,"yyyy-mm")2026-07No, textYesLabels only; format codes can depend on the language of Excel
=MONTH(A2)7No, number 1–12NoSeasonality across years, never for a timeline

The most dangerous one is MONTH(A2). It returns 7 for July 2025 and for July 2026 alike, so a report that groups by MONTH silently merges both years. That is fine for a seasonality chart that deliberately compares all Julys, but fatal for a timeline, a YTD or a year-over-year calculation. Text keys from TEXT keep the year but are no longer dates: you cannot add a month to "2026-07", and the format codes can differ between language versions of Excel. A real date such as the month end avoids all of these issues.

Step by step: build month keys and a monthly summary

Follow along in your own workbook or directly in the lab at the top of the page, where the Coach checks D7, E11, B22 and C21.

  1. Make sure the order dates in column A are real dates: select a cell and look at the number format, or temporarily switch to General. A real date turns into a number such as 46176; text stays as it is.
  2. In D2 type =EOMONTH(A2,0) and press Enter. Select D2:D17 and press Ctrl+D to fill it down.
  3. If the keys show numbers like 46203, select D2:D17 and press Ctrl+Shift+#, or use Ctrl+1 > Number > Date. For a compact label choose Custom and type mmm yyyy: the cell then shows "Jun 2026" but still holds the full date.
  4. In E2 type =EOMONTH(A2,-1)+1 and fill down to E17. Format it as a date as well.
  5. In A20:A23 type the four month ends, or type the first one and use =EOMONTH(A20,1) in A21 copied down, so the list of keys extends itself.
  6. In B20 type =SUMIFS($C$2:$C$17,$D$2:$D$17,A20). Use F4 to add the dollar signs to the two ranges, but leave A20 relative. Fill down to B23.
  7. In C20 type =COUNTIFS($A$2:$A$17,">="&EOMONTH(A20,-1)+1,$A$2:$A$17,"<="&A20) and fill down to C23.
  8. Check the totals: =SUM(B20:B23) must equal =SUM(C2:C17), and =SUM(C20:C23) must equal =COUNT(A2:A17).
  9. Optional: convert the order list to an Excel Table with Ctrl+T. New orders typed below the list then get their month key automatically, and SUMIFS with structured references such as Orders[Amount] includes them without changing any range.
A PivotTable can also group dates by month (right-click a date in the PivotTable > Group > Months and Years). It is great for exploring. Formulas are better when the numbers must sit in a fixed report layout, update without a refresh and feed further calculations such as YoY growth.

Excel sheet with order dates grouped into month keys using EOMONTH and monthly totals with SUMIFS
The course builds a full set of time-intelligence measures in Excel, starting from the month keys of this free lesson.

Common mistakes and how to spot them

  • Using EOMONTH(A2,1) instead of 0. The second argument counts months forward, so 1 gives the end of the next month. Symptom: every order lands one month too late, and June shows no sales.
  • Using EOMONTH(A2,-1) as the month start. That is the last day of the previous month. Add 1. Symptom: the month start of a 1 August order shows 31 July.
  • Matching order dates against a month end. =SUMIFS(C2:C17,A2:A17,A22) looks for orders placed exactly on 31 August and usually returns 0. Match the keys in column D, or use two bounds.
  • Keys that show as numbers. EOMONTH returns a serial number. A key column full of values like 46234 is correct but unformatted. Apply a date format.
  • Dates stored as text. Imported dates such as "03.06.2026" may be text. EOMONTH then returns #VALUE!. Convert them with Data > Text to Columns (choose the date order in step 3) or with DATE and the text functions.
  • Timestamps on the last day. If dates include a time, 31 Aug 14:30 is larger than the number for 31 Aug, so "<="&A22 misses it. With timestamps, use "<"&A22+1 as the upper bound. The key column is safe either way, because EOMONTH ignores the time.
  • Grouping by MONTH across years. July 2025 and July 2026 become one bucket. Use a key that keeps the year.
  • Unlocked ranges. Without $ signs, the SUMIFS ranges move down as you copy, and the later months are summed over the wrong rows. Spot it by a total that does not match the order list.

Quick reference: functions and shortcuts used

Quick reference for this lesson
Function / shortcutWhat it doesExample
EOMONTH(start_date, months)Last day of the month, shifted by a number of months=EOMONTH(A2,0)
EOMONTH(…,-1)+1First day of the same month=EOMONTH(A2,-1)+1
DATE, YEAR, MONTHBuild or take apart a date=DATE(YEAR(A2),MONTH(A2),1)
SUMIFSSum with one or more conditions=SUMIFS($C$2:$C$17,$D$2:$D$17,A20)
COUNTIFSCount with one or more conditions=COUNTIFS($A$2:$A$17,">="&E2)
">="&dateBuilds a date criterion from an operator and a date">="&EOMONTH(A20,-1)+1
Ctrl+;Types today's date into the cellQuick test dates
Ctrl+Shift+#Applies a date format to a serial numberFix keys that show 46203
Ctrl+1 > CustomShow a key as a month label without changing itFormat code mmm yyyy
F4Locks a reference with $ signs$C$2:$C$17

Real-world uses of month keys

  • Monthly sales reports. Export orders from a shop or till system, add a month key and get sales and order counts per month without filtering by hand.
  • Expense tracking. Group card or bank transactions by month and by category with a SUMIFS on the month key and the category column.
  • Billing and subscriptions. Find which billing month a sign-up or cancellation belongs to, and count active customers per month.
  • Payroll and timesheets. Sum hours or overtime per employee per month from daily time records.
  • Budget vs actual. A budget usually exists per month. With month keys on the actuals, a SUMIFS lines them up with the budget months exactly.

What you will build in the rest of this course

Month keys and month bounds are the building blocks. The following lessons turn them into the measures every management report needs, each with a lab on Larkspur's data.

Month-to-Date (MTD): SUMIFS Between the Month Start and the Report Date. You build an MTD block from a single report date, compare it with the same days of last month and estimate a full-month run-rate. This fixes the half-September problem you saw above.

Year-to-Date (YTD) and Prior-Year YTD with SUMIFS and EDATE. You calculate YTD sales up to the last closed month and the comparable prior-year YTD, using a year start, EDATE(…,-12) and the same window pattern.

Year-over-Year (YoY): Variance, Growth % and the "New" Case. You compare 2026 with 2025 month by month, calculate the correct YTD growth and keep the formulas clean when a category had no sales last year.

Rolling 12 Months: Moving Totals, Averages and a Trend Chart. You calculate R12 (also called LTM or TTM) totals and averages for any report month and chart a trend that is free of seasonal noise.

Fiscal Years Starting in April: FY, Fiscal Quarter and Fiscal YTD. You map every month to a fiscal year and quarter that start in April and calculate fiscal YTD and the sales of a chosen fiscal quarter.

Like-for-Like (Same-Store) Growth with COUNTIFS Flags. You flag which stores are comparable using opening dates and a closure log, then see how like-for-like growth differs from total growth.

Mid-Course Project: KPI Tiles (Month, YTD, YoY, R12) and a Current vs Prior Year Chart. You drive a whole KPI page from one report-month cell: YTD, YoY growth of YTD, rolling twelve months and a line chart of this year against last year.

Summary

Dates in Excel are numbers, and a month is a range of those numbers. =EOMONTH(A2,0) gives every date a month key (the last day of its month) that is still a real date, and =EOMONTH(A2,-1)+1 gives the month start. With keys, a monthly total is =SUMIFS(amounts,keys,key); without them, COUNTIFS or SUMIFS with the conditions ">="&start and "<="&end does the same. Avoid MONTH for timelines, format keys as dates, watch out for partial months and timestamps, and always check that the monthly totals add up to the full list.

Now try it in the lab above: build the month keys and month starts for Larkspur's sixteen orders and fill in the monthly summary with SUMIFS and COUNTIFS. The Coach checks each step. It takes about fifteen minutes and it is free.

Frequently asked questions

How do I group dates by month in Excel?

Add a helper column with =EOMONTH(A2,0), which turns every date into the last day of its month. Then sum or count per month with SUMIFS or COUNTIFS on that column.

What does EOMONTH do in Excel?

EOMONTH(start_date, months) returns the last day of the month that is the given number of months before or after start_date. With 0 it returns the end of the same month, with -1 the end of the previous month.

How do I get the first day of the month from a date in Excel?

Use =EOMONTH(A2,-1)+1, the day after the previous month end. =DATE(YEAR(A2),MONTH(A2),1) gives the same result.

How do I sum values by month in Excel?

With a month-key column: =SUMIFS(amounts, keys, month_key). Without one, use two date conditions: =SUMIFS(amounts, dates, ">="&month_start, dates, "<="&month_end).

Why does EOMONTH return a number instead of a date?

Excel stores dates as serial numbers, and EOMONTH returns one. Format the cell as a date with Ctrl+Shift+# or Ctrl+1 > Number > Date.

Should I use MONTH or EOMONTH to group by month?

Use EOMONTH for timelines, because it keeps the year and stays a real date. MONTH returns only 1 to 12, so the same month of different years falls into one group.

Keep going: Excel Time Intelligence: MTD, YTD, YoY, Rolling 12 Months & Fiscal Years

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time €9.90.

  1. Month-to-Date (MTD): SUMIFS Between the Month Start and the Report Date
  2. Year-to-Date (YTD) and Prior-Year YTD with SUMIFS and EDATE
  3. Year-over-Year (YoY): Variance, Growth % and the "New" Case
  4. Rolling 12 Months: Moving Totals, Averages and a Trend Chart
  5. Fiscal Years Starting in April: FY, Fiscal Quarter and Fiscal YTD
  6. Like-for-Like (Same-Store) Growth with COUNTIFS Flags
  7. Mid-Course Project: KPI Tiles (Month, YTD, YoY, R12) and a Current vs Prior Year Chart
  8. Quarter-to-Date (QTD): Quarter Start, QTD Sales and Prior-Year QTD
  9. Running YTD That Restarts Every January, and a Cumulative Year Chart
  10. Fair Month Comparisons: Open Days, Sales per Day and Calendar Effects
  11. Actual vs Budget: YTD Budget, Variance % and the Pace Still Needed
  12. Full-Year Outlook: Run-Rate, Prior-Year Pattern and Remaining Budget
  13. Month-over-Month vs Rolling 3 Months: Reading Short-Term Trends Without Seasonal Noise
  14. YTD by Channel: Growth Rates vs Contribution to Total Growth
  15. Check the Data Before You Report: Duplicate and Missing Months, Ledger Reconciliation
  16. Seasonality in Numbers: Seasonal Index, Share of Year and a Seasonal Estimate
  17. One Selector for Month, QTD, YTD and R12: Period Start with IFS
  18. YTD Ratio KPIs: Orders, Average Order Value and a Volume vs Price Split
  19. Final Project: Time-Intelligence Dashboard for the Online Channel

Buy course — €9.90 See the full course