How can one create an XLstatements report showing rolling periods? Here’s an example of a twelve-month rolling report (click to expand):
I’m using the good old “Solomon” demo data here, which has only a few months of data, so it looks a bit odd. The first thing I did was put a reference to my cell named Pd (A5) above my last column in cell N2. I also referenced my FiscYr cell below that in cell N3. Next I move to the column to the left and enter a formula in M2, referring to the value in N2:
This formula is:
And I use another IF formula in M3, for the fiscal year:
I then copy those two formulas to the left ten columns (by selecting the two cells M2 and M3 and then dragging the fill handle to the left).
To make the column headers, I used this formula in cell C6:
PDMONTH is a XLstatements function that returns a month name from the period number, and I am using the Excel LEFT function to get just the first three letters in each month name. I then copy that formula to the eleven cells to its left.
For the PTDBAL functions of the report, I used the values from rows 2 and 3, making sure to make the row reference absolute and the column relative, e.g., cell C7 has this formula:
I then copied that formula to all the rows and columns.
If you don’t want your report to include the rows with the period numbers and years (rows 2 and 3 in this example), you can hide the rows you inserted for them: