It is a common task that we want to input and maintain all data on one worksheet, and display summary on different worksheets. A typical layout will be similar to the screenshot shown above. One “Input” sheet, and then one sheet for displaying summary for each month. In this way, a total of 13 worksheets will be displayed on your workbook. Indeed, this was a question to me…
Can it be done?
Of course it can be done. BUT we could do it doesn’t mean we should do it.
My suggestion is to hold only ONE sheet to display the monthly summary on which users have the flexibility to select any month (or any period) by using Pivot Table Timeline.
Here’s the layout of the proposed solution:
You may download a sample file to follow along.
Note: The file is saved as .xlsm (macro-enable) format. Please enable content when prompted if you wish to see the auto-refresh action.
There are many ways to achieve the similar result. To me, Pivot Table is the best way. 😉
First Thing First
Before we create the pivot table, we have to think about how we can capture new data in the summary. Maybe whole column referencing is on your mind (which I highly discourage). Perhaps you know how to set dynamic name range with the use of OFFSET. But you know what, whenever we need to deal with dynamic range to anticipate new data from time to time, Excel Table is the best option. No doubt!
Insert Excel Table
- Go to Insert tab
- Select Table
- Confirm the range of data; and confirm if your table has headers
As a good practice, name your Table
- When the Table is selected, go to Table Design tab
- Rename it to “Data”
Insert Pivot Table
- Go to Insert tab
- Click PivotTable
- Input the Table name, i.e. Data
- Select where you want to insert the pivot table -> “New Worksheet” in our case
- Drag the data fields to the corresponding areas of the pivot table (per your need)
- Rename the worksheet (per your need)
PivotTable Timeline is a handy feature added to Excel 2016 (or later for Windows). It requires a column of “date” in the data source for the pivot table. It then automatically groups dates into calendar month, quarter and year for user’s selection. Check it out!
Select any cell in the pivot table
- Go to PivotTable Analyze tab
- Insert Timeline
- Select the data field “Date“
Note: a few blank rows have been inserted on top for placing the Timeline
Here we go!
- Resize the timeline to fit your pivot table layout
- Turn off the “Autofit column widths on update” in PivotTable Options
As you see, we don’t need 12 separate sheets for each month. We can have one summary sheet where we can select which month(s) of data we want to look into. We can even change the intervals to quarter or year on the timeline. Isn’t it a better option?
Wait… The figures do not update automatically. A manual refresh is required after new data added or old data updated in the data source. This is not ideal. I know. You know.
Macro comes to recuse
No worry. This limitation can be overcome with a simple macro that refreshes all pivot tables when the worksheet holding the pivot table is selected. In this way, user will always see updated data without refreshing the pivot table manually.
Not familiarize with Marco? Me either 😅
Please tell me what you think by leaving comments below.