
The logic in the layout (Report Month2) then says, given the calendar year and month you want to report on, subtract it from the current calendar year and month to work out the difference between the two (in months). Then subtract that number of months from the current year and period for ABX and ABC to give the corresponding reporting year and period for each company. So the layout starts by stating the current calendar year and period. We've typed the values in directly for demonstration purposes but in a real layout it would be better to use date functions for this. The period value just returns the numeric value for the given month.

We then enter the calendar year and period that we want to report on. This would obviously never be higher than the current year and period.

Next, the difference between the two is calculated in months and that value is converted into years and months.

We subtract that number of years and months from the current year and period for both ABX and ABC as given in the Settings sheet. The formulas here become complicated because they need to take into account instances where the number of months to subtract is higher than the period you are subtracting from, another year needs to be deducted. The financial formulas are based on the results.
