Creating Time-Based Structures
メニューを表示するにはスワイプしてください
Forecasting is fundamentally about time. To build moving averages, detect seasonality, group data by period, and create multi-year trend charts, you need clean time dimensions.
Essential Date-Extraction Formulas
All of these work from the Order_Date column (column B):
=YEAR(B2) → extracts the year (2022, 2023, 2024)
=MONTH(B2) → extracts the month number (1–12)
=DAY(B2) → extracts the day of the month
=TEXT(B2,"MMMM") → full month name ("August")
=TEXT(B2,"MMM") → abbreviated month name ("Aug")
=WEEKNUM(B2) → week number of the year (1–53)
=WEEKDAY(B2,2) → day of week (1=Monday, 7=Sunday)
=EOMONTH(B2,0) → last day of the order's month
=DATE(YEAR(B2),MONTH(B2),1) → first day of the order's month
The last one — the Month_Start date — is the single most useful time column you'll build. When you aggregate revenue by it, Excel's charts automatically create clean monthly trend lines.
Building a Month_Start Column
In a new column (column V), add the header Month_Start and enter:
=DATE(YEAR(B2),MONTH(B2),1)
Autofill down all 1,500 rows, then format the column as a date (Ctrl+1 → Date → MMM-YY style). Every row now has a groupable, sortable monthly anchor that PivotTables and SUMIFS can work with directly.
Creating Rolling Period Labels
Rolling labels let you flag and filter the most recent N months dynamically, without manually updating ranges every month:
=TEXT(B2,"YYYY-MM") → sortable period label: "2022-08"
Rolling 12-month flag:
=IF(B2>=EDATE(TODAY(),-12),"In","Out")
Rolling 3-month flag:
=IF(B2>=EDATE(TODAY(),-3),"In","Out")
Year-to-date flag:
=IF(AND(YEAR(B2)=YEAR(TODAY()),B2<=TODAY()),"YTD","")
The EDATE function is the cleanest way to shift dates by whole months. EDATE(TODAY(),-12) always gives you exactly 12 months ago, regardless of how many days are in each month.
Building a Calendar Table
A Calendar Table is a standalone lookup table listing every month in your dataset alongside its Year, Quarter, Month Number, and period labels. It acts as the time dimension backbone for all PivotTable relationships and SUMIFS formulas — rather than deriving these values repeatedly inside each formula, you look them up once from a single authoritative source.
Create a new sheet called Calendar_Table with the following structure:
For Period_Date, enter 2022-01-01 in the first row, then use =EDATE(A2,1) in every row below and autofill down to December 2026 — that gives you 60 rows covering all historical data plus a 2-year forecast runway.
Build your Calendar Table to span at least 2 years beyond your forecast horizon. You will reuse it in every model in this course without modification.
Task 1: Build Time-Based Helper Columns
Goal: Add the time dimensions the forecasting models in later sections depend on.
- In column V of your data sheet, add the header Month_Start and enter
=DATE(YEAR(B2),MONTH(B2),1). Autofill down all 1,500 rows and format the column as MMM-YY. - In column W, add the header Period_Label and enter
=TEXT(B2,"YYYY-MM"). This will be used as a chart axis label and PivotTable grouping key. - In column X, add the header Rolling_12M and enter
=IF(B2>=EDATE(TODAY(),-12),"In","Out")to flag the most recent 12 months. - In a blank cell, use
=COUNTIF(X2:X1501,"In")to count how many rows fall inside the rolling window — note the number for later reference. - Add one more column Y with the header
YTD_Flagand enter=IF(AND(YEAR(B2)=MAX(YEAR(Business_Data[Order_Date])),MONTH(B2)<=MONTH(TODAY())),"YTD",""). This flags rows from the most recent year in the dataset (2024) whose month falls on or before the current month — simulating a YTD view as if the data were live.
Task 2: Create the Calendar Table
Goal: Build the shared time dimension that all forecast models will reference.
- Insert a new sheet and name it
Calendar_Table. - In cell A1, type
Period_Date. In cell A2, enter2022-01-01. In A3, enter=EDATE(A2,1)and autofill down to row 61 — that covers January 2022 through December 2026. - Select column A and go to Home → Number Format dropdown. Choose Short Date.
- Add columns B through H using the formulas from the table above (Year, Quarter_Num, Quarter_Label, Month_Num, Month_Name, Month_Short, Period_Label).
- Format the header row with a dark fill and white bold text to distinguish it visually.
- Select the full range
A1:H61and pressCtrl+Tto convert it to an Excel Table. Name the tableCalendar_Tablein the Table Design tab. - Verify the table by checking that row 38 shows
2025-01-01in Period_Date,2025in Year, andQ1in Quarter_Label.
A completed workbook is attached for comparison and troubleshooting if needed.
フィードバックありがとうございます!
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください