Home > Articles > Home & Office Computing > Microsoft Applications

Predictive Analytics with Microsoft Excel: Working with Seasonal Time Series

This chapter from More Predictive Analytics: Microsoft Excel takes a look at how to decompose a time series so that you can see how its seasonality operates apart from its trend (if any).
This chapter is from the book

Matters get incrementally more complicated when you have a time series that’s characterized in part by seasonality: the tendency of its level to rise and fall in accordance with the passing of the seasons. We use the term season in a more general sense than its everyday meaning of the year’s four seasons. In the context of predictive analytics, a season can be a day if patterns repeat weekly, or a year in terms of presidential election cycles, or just about anything in between. An eight-hour shift in a hospital can represent a season.

This chapter takes a look at how to decompose a time series so that you can see how its seasonality operates apart from its trend (if any). As you might expect from the material in Chapters 3 and 4, several approaches are available to you.

Simple Seasonal Averages

The use of simple seasonal averages to model a time series can sometimes provide you with a fairly crude model for the data. But the approach pays attention to the seasons in the data set, and it can easily be much more accurate as a forecasting technique than simple exponential smoothing when the seasonality is pronounced. Certainly it serves as a useful introduction to some of the procedures used with time series that are both seasonal and trended, so have a look at the example in Figure 5.1.

Figure 5.1

Figure 5.1 With a horizontal model, simple averages result in forecasts that are no more than seasonal means.

The data and chart shown in Figure 5.1 represent the average number of daily hits to a website that caters to fans of the National Football League. Each observation in column D represents the average number of hits per day in each of four quarters across a five-year time span.

Identifying a Seasonal Pattern

You can tell from the averages in the range G2:G5 that a distinct quarterly effect is taking place. The largest average number of hits occurs during fall and winter, when the main 16 games and the playoffs are scheduled. Interest, as measured by average daily hits, declines during the spring and summer months.

The charted data series includes data labels showing which quarter each data point belongs to. The chart echoes the message of the averages in G2:G5: Quarters 1 and 4 repeatedly get the most hits. There’s clear seasonality in this data set.

Calculating Seasonal Indexes

After you’ve decided that a time series has a seasonal component, you’d like to quantify the size of the effect. The averages shown in Figure 5.2 represent how the simple-averages method goes about that task.

Figure 5.2

Figure 5.2 Combine the grand mean with the seasonal averages to get the seasonal indexes.

In Figure 5.2, you get additive seasonal indexes in the range G10:G13 by subtracting the grand mean in cell G7 from each seasonal average in G2:G5. The result is the “effect” of being in Quarter 1, that of being in Quarter 2, and so on. If a given month is in Quarter 1, you expect it to have 99.65 more average daily hits than the grand mean of 140.35 hits per day.

This information gives you a sense of how important it is to be in a given season. Suppose that you own the web site in question and you want to sell advertising space on it. You can surely ask a higher price of advertisers during the first and fourth quarters than during the second and third. More to the point, you can likely charge twice as much during the first quarter than during either the second or the third.

With the seasonal indexes in hand, you’re also in a position to calculate seasonal adjustments. For example, still in Figure 5.2, the seasonally adjusted values for each quarter in 2005 appear in G16:G19. They’re calculated by subtracting the index from the associated quarterly measurement.

Notice that in the normal course of events from 2001 to 2005, you expect the second quarter’s results to lag behind the first quarter’s results by 133.6 (that is, 99.65 minus –33.95). But in both 2004 and 2005, the seasonally adjusted results for the second quarter exceed those for the first quarter. That outcome might well prompt you to ask what has changed in the final two years that reverses the relationship between the seasonally adjusted results for the first two quarters. (I don’t pursue that issue here. I bring it up to suggest that you often want to have a look at both the observed and the seasonally adjusted figures.)

Forecasting from Simple Seasonal Averages: No Trend

Although the method of simple averages is—as I said earlier—crude, it can be much more accurate than the more sophisticated alternative of exponential smoothing, particularly when the seasonal effects are pronounced and reliable.

When the time series is untrended, as is the case with the example this section has discussed, the simple seasonal forecasts are nothing more than the seasonal averages. When the series is not trending either up or down, your best estimate of the value for the next season is that season’s historic average. See Figure 5.3.

Figure 5.3

Figure 5.3 Combine the grand mean with the seasonal averages to get the seasonal indexes.

In the chart in Figure 5.3, the dashed line represents the forecasts from simple smoothing. The two solid lines represent the actual seasonal observations and the seasonal averages. Notice that the seasonal averages track the actual seasonal observations quite closely—much more closely than do the smoothed forecasts. You can see how much more closely from the two RMSEs in cells F23 and H23. The RMSE for the seasonal averages is just a little more than a third of the RMSE for the smoothed forecasts.

You can chalk that up to the size of the seasonal effects as well as their consistency:

  • Suppose, for example, that the difference between the average first and second quarters were 35.0 instead of 133.6 (which is the difference between cells G2 and G3 in Figure 5.2). Then, in a smoothing context, the actual value for Quarter 1 would be a much better predictor of the value for Quarter 2 than is the case with this time series. And exponential smoothing can rely heavily on the value of the current observation for its forecast of the next period. If the smoothing constant is set at 1.0, exponential smoothing resolves to naïve forecasting and the forecast always equals the prior actual.
  • The fact that the size of each seasonal swing is so consistent from quarter to quarter means that the simple seasonal averages are reliable forecasts: No actual quarterly observation departs very far from the overall seasonal average.

Simple Seasonal Averages with Trend

The use of simple seasonal averages with a trended series has some real drawbacks, and I’m tempted to suggest that we ignore it and move on to meatier topics. But it’s possible that you’ll run into situations in which someone has used this method and then it won’t hurt to know both how it works and why there are better choices.

Any method of dealing with seasonality in a trended series must deal with the fundamental problem of disentangling the effect of the trend from that of the seasonality. Seasonality tends to obscure trend, and vice versa. See Figure 5.4.

Figure 5.4

Figure 5.4 The presence of trend complicates the calculation of seasonal effects.

The fact that the trend in the series is upward over time means that simply averaging each season’s observations, as was done in the no-trend case, confounds the general trend with the seasonal variation. The usual idea is to account for the trend separately from the seasonal effects. You could quantify the trend and subtract its effect from the observed data. The result is an untrended series that retains the seasonal variation. It could be handled in the same fashion as I illustrated earlier in this chapter.

Calculating the Mean for Each Year

One way to detrend the data (and other ways will doubtless occur to you) is to calculate the trend based on yearly averages rather than quarterly data. The idea is that the yearly average is insensitive to the seasonal effects. That is, if you subtract a year’s mean from the value for each of its quarters, the sum (and thus the average) of the four quarterly effects is precisely zero. So a trend calculated using the yearly averages is unaffected by the seasonal variations. This calculation appears in Figure 5.5.

Figure 5.5

Figure 5.5 This method now imposes linear regression on the simple averages.

The first step in detrending the data is to get the average daily hits for each year. That’s done in the range H3:H7 in Figure 5.5. The formula in cell H3, for example, is =AVERAGE(D3:D6).

Calculating the Trend Based on Annual Means

With the yearly averages in hand, you’re in a position to calculate their trend. That’s managed by using LINEST() in the range I3:J7, using this array formula:


The point of this exercise is to quantify the year-to-year trend, and LINEST() does that for you in cell I3. That cell contains the regression coefficient for the x-values. Multiply 106.08 by 1; then by 2; then by 3, 4, and 5; and add to each result the intercept of 84.63. Although that gets you annual forecasts, the important point for this procedure is the value of the coefficient 106.08, which quantifies the annual trend.

Prorating the Trend Across Seasons

The simple-averages method of dealing with a trended, seasonal series such as this one continues by dividing the trend by the number of periods in the encompassing period to get a per-period trend. Here, the number of periods per year is four—we’re working with quarterly data—so we divide 106.08 by 4 to estimate the trend per quarter at 26.5.

The procedure uses that periodic trend by subtracting it from the average periodic result. The purpose is to remove the effect of the annual trend from the seasonal effects. First, though, we need to calculate the average result across all five years for Period 1, for Period 2 and so on. To do that, it helps to rearrange the list of actual quarterly hits, shown in the range D3:D22 of Figure 5.5, into a matrix of five years by four quarters, shown in the range G11:J15. Notice that the values in that matrix correspond to the list in column D.

With the data arranged in that fashion, it’s easy to calculate the average quarterly value across the five years in the data set. That’s done in the range G18:J18.

The effect of the trend returned by LINEST() appears in the range G19:J19. The starting value for each year is the observed mean daily hits for the first quarter, so we make no adjustment for the first quarter. One quarter’s worth of trend, or 26.5, is subtracted from the second quarter’s mean hits, resulting in an adjusted second-quarter value of 329.9 (see cell H21, Figure 5.5). Two quarters’ worth of trend, 2 × 26.5 or 53 in cell I19, is subtracted from the third quarter’s mean to get an adjusted third-quarter value of 282.6 in cell I21. And similarly for the fourth quarter, subtracting three quarters of trend from 454.4 to get 374.8 in cell J21.

Converting the Adjusted Seasonal Means to Seasonal Effects

Per the logic of this method, the values shown in rows 20–21 of Figure 5.5 are the average quarterly results for each of four quarters, with the effect of the general upward trend in the data set removed. (Rows 20 and 21 are merged in columns G through J.) With their trend out of the way, we can convert those figures to estimates of seasonal effects: the result of being in the first quarter, in the second quarter, and so on. To get those effects, start by calculating the grand mean of the adjusted quarterly means. That adjusted grand mean appears in cell I23.

The analysis continues in Figure 5.6.

Figure 5.6

Figure 5.6 The quarterly effects, or indexes, are used to deseasonalize the observed quarterlies.

Figure 5.6 repeats the quarterly adjustments and the adjusted grand mean from the bottom of Figure 5.5. They are combined to determine the quarterly indexes (which you can also think of as seasonal effects). For example, the formula in cell D8 is as follows:


It returns –33.2. That’s the effect of being in the second quarter, vis-à-vis the grand mean: With respect to the grand mean, we can expect a result that belongs to the second quarter to fall below the grand mean by 33.2 units.

Applying the Seasonal Effects to the Observed Quarterlies

To recap: Thus far, we’ve quantified the annual trend in the data via regression and divided that trend by 4 to prorate it to a quarterly value. Picking up in Figure 5.6, we adjusted the mean for each quarter (in C3:F3) by subtracting the prorated trends in C4:F4. The result is a detrended estimate of the mean for each quarter, regardless of the year in which the quarter takes place, in C5:F5. We subtracted the adjusted grand mean, in cell G5, from the adjusted quarterly means in C5:F5. That converts each quarter’s mean to a measure of the effect of each quarter relative to the adjusted grand mean. Those are the seasonal indexes or effects in C8:F8.

Next we remove the seasonal effects from the observed quarterlies. As shown in Figure 5.6, you do so by subtracting the quarterly indexes in C8:F8 from the corresponding values in C12:F16. And the easiest way to do that is to enter this formula in cell C20:


Note the single dollar sign before the 8 in the reference to C$8. That’s a mixed reference: partly relative and partly absolute. The dollar sign anchors the reference to the eighth row, but the column portion of the reference is free to vary.

Therefore, after the latter formula is entered in cell C20, you can click on the cell’s selection handle (the small square in the lower-right corner of a selected cell) and drag right into cell F20. The addresses adjust as you drag right and you wind up with the values, with the seasonal effects removed, for year 2001 in C20:F20. Select that range of four cells and use the multiple selection’s handle, now in F20, to drag down into row 24. So doing fills the remainder of the matrix.

I have charted those seasonally adjusted values in Figure 5.6. Compare that chart to the chart in Figure 5.4. Notice in Figure 5.6 that although the deseasonalized values do not lie precisely on a straight line, much of the seasonal effect has been removed.

Regressing the Deseasonalized Quarterlies onto the Time Periods

The next step is to create forecasts from the seasonally adjusted, trended data in Figure 5.6, cells C20:F24, and at this point you have several alternatives available. You could use the differencing approach combined with simple exponential smoothing that was discussed in Chapter 3, “Working with Trended Time Series.” You could also use Holt’s approach to smoothing trended series, discussed in both Chapter 3 and Chapter 4, “Initializing Forecasts.” Both methods put you in a position to create a one-step-ahead forecast, to which you would add the corresponding seasonal index.

Another approach, which I’ll use here, first puts the trended data through another instance of linear regression and then adds the seasonal index. See Figure 5.7.

Figure 5.7

Figure 5.7 The first true forecast is in row 25.

Figure 5.7 returns the deseasonalized quarterly means from the tabular arrangement in C20:F24 of Figure 5.6 to the list arrangement in the range C5:C24 of Figure 5.7.

We could use LINEST() in conjunction with the data in B5:C24 in Figure 5.7 to calculate the regression equation’s intercept and coefficient; then, we could multiply the coefficient by each value in column B, and add the intercept to each product, to create the forecasts in column D. But although LINEST() returns useful information other than the coefficient and intercept, TREND() is a faster way to get the forecasts, and I use it in Figure 5.7.

The range D5:D24 contains the forecasts that result from regressing the deseasonalized quarterly figures in C5:C24 onto the period numbers in B5:B24. The array formula used in D5:D24 is this:


That set of results reflects the effect of the general upward trend in the time series. Because the values that TREND() is forecasting from have been deseasonalized, it remains to add the seasonal effects, also known as seasonal indexes, back in to the trended forecast.

Adding the Seasonal Indexes Back In

The seasonal indexes, calculated in Figure 5.6, are provided in Figure 5.7, first in the range C2:F2 and then repeatedly in the range E5:E8, E9:E12, and so on. The reseasonalized forecasts are placed in F5:F24 by adding the seasonal effects in column E to the trend forecasts in column D.

To get the one-step-ahead forecast in cell F25 of Figure 5.7, the value of t for the next period goes into cell B25. The following formula is entered in cell D25:


It instructs Excel to calculate the regression equation that forecasts values in the range C5:C24 from those in B5:B24, and apply that equation to the new x-value in cell B25.

The appropriate seasonal index is placed in cell E25, and the sum of D25 and E25 is placed in F25 as the first true forecast of the trended and seasonal time series.

You’ll find the entire set of deseasonalized quarterlies and the forecasts charted in Figure 5.8.

Figure 5.8

Figure 5.8 The seasonal effects are returned to the forecasts.

Evaluating Simple Averages

The approach to dealing with a seasonal time series, discussed in several prior sections, has some intuitive appeal. The basic idea seems straightforward:

  1. Calculate an annual trend by regressing annual means against a measure of time periods.
  2. Divide the annual trend among the periods within the year.
  3. Subtract the apportioned trend from the periodic effects to get adjusted effects.
  4. Subtract the adjusted effects from the actual measures to deseasonalize the time series.
  5. Create forecasts from the deseasonalized series, and add the adjusted seasonal effects back in.

My own view is that several problems weaken the approach, and I would not have included it in this book except that you are likely to encounter it and therefore should be familiar with it. And it provides a useful springboard to discuss some concept and procedures found in other, stronger approaches.

First, there’s the issue (about which I complained earlier in this chapter) regarding the very small sample size for the regression of annual means onto consecutive integers that identify each year. Even with only one predictor, as few as 10 observations is really scraping the bottom of the barrel. At the very least you should look at the resulting R2 adjusted for shrinkage and probably recalculate the standard error of estimate accordingly.

It’s true that the stronger the correlation in the population, the smaller the sample you can get away with. But working with quarters within years, you’re fortunate to find as many as 10 years’ worth of consecutive quarterly observations, each measured in the same way across that span of time.

I’m not persuaded that the answer to the problematic up-and-down pattern you find within a year (see the chart in Figure 5.4) is to average out the peaks and valleys and get a trend estimate from the annual means. Certainly it’s one answer to that problem, but, as you’ll see, there’s a much stronger method of segregating the seasonal effects from an underlying trend, accounting for them both, and forecasting accordingly. I’ll cover that method later in this chapter, in the “Linear Regression with Coded Vectors” section.

Furthermore, there’s no foundation in theory for distributing the annual trend evenly among the periods that compose the year. It’s true that linear regression does something similar when it places its forecasts on a straight line. But there’s a huge gulf between making a fundamental assumption because the analytic model can’t otherwise handle the data, and accepting a flawed outcome whose flaws—errors in the forecasts—can be measured and evaluated.

That said, let’s move on to the use of moving averages instead of simple averages as a way of dealing with seasonality.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020