The following functions compliments Consolidated XL functions used to hot link Period Heading Names. GLYearPeriodName() and GLPeriodDate() are used to get Dates relating to the given parameters.
GetRelativePeriod() and GetRelativeYear() are used to drive our wizard reports. Given a target Year/Period they can calculate the correct Year/Period to get according to the current required period structure (Accounting/Calander Periods/Quarter and Weeks). Allowing the designer to add column headings which when the user changes Period/Year parameters return Period/Year headings for display, which would be tricky to do with your own fomrula.
The Wizard "Get GL Values Example Wizard" shows how to use the functions below. It's best to create a sheet using the wizard, to understand the use and possibilities.
Below is an example of output for Accounting Period, Accounting Quarters, Calendar Month (Jan-Dec), or 52 weeks of the Year (Jan-Dec).
Get Period Name showing examples of different style, for different period options
For a tutorial on this function, click here
Function GetPeriodDate returns the date of the first day of a Period. Excel formatting can be then used to display in your desired format.
Function GetRelativePeriod() and GetRelativeYear() return Period or Year relative to the input Period or Year. This allows a cell to contain Year and Period, say period 3, 2023, and in a series of cells go back 6 periods but adjust the Year and Period accordingly by X periods in a series of columns.
In a series of columns we have period 3, 2023 in the last column on the right. We need asdjust back 6 periods.
In CXL Wizards, where the user enters a Year and Period and displays multiple periods in columns, functions are used to drive the Period and Year for the column below. As you can see in the screenshot below:
"P&L / Income Statement" and "Sales report" wizards populate Row 4 with -11 to 0, and CXL.GetRelativeYear() and CXL.GetRelativePeriod() calculate a Period and Year based on the current options. Thus, if the Period Aging is changed to Quarters, or Weeks, the Periods and Years are calculated accordingly.
Column G above calculates Relative Period -8 (back 8 periods in G4), creating a column period of 11/2022 from the last period of 7/2023 (set in C16 and C17).
Reference Guide CXL.GetRelativeYear( CompCode, InputYear, X, [Options] ) and CXL.GetRelativePeriod( CompCode, InputPeriod, X, [Options] )
The Income Statement/P&L Wizard uses these functions as shown in the screen shot.