"""Formulas from sheet 'Costs' of 'fpna_month_end.xlsx'. Generated by Power Migrate 0.1.0a1 (no-AI mode). One function per logic block, in the order they appear on the sheet; ``model.compute`` runs them in dependency order. """ from .. import xl from ..xl import Book def month_index(book: Book) -> None: r"""Month index Costs!C2:M2 (11 columns, copied across). Excel (C2): =B2+1 Pattern (R1C1): =RC[-1]+1 Reads: Costs!B2 """ costs = book['Costs'] for c in range(3, 14): costs[2, c] = costs[2, c - 1] + 1 def headcount(book: Book) -> None: r"""Headcount Costs!B3:M3 (12 columns, copied across). Excel (B3): =ROUND(HeadcountStart*(1+GrowthRate)^(B2-1),0) Pattern (R1C1): =ROUND(HeadcountStart*(1+GrowthRate)^(R[-1]C-1),0) Reads: Assumptions!B5, Assumptions!B8, Costs!B2, name GrowthRate, name HeadcountStart """ costs = book['Costs'] for c in range(2, 14): costs[3, c] = xl.ROUND(book.name('HeadcountStart') * (1 + book.name('GrowthRate')) ** (costs[2, c] - 1), 0) def salary_cost(book: Book) -> None: r"""Salary cost Costs!B4:M4 (12 columns, copied across). Excel (B4): =B3*AvgSalary/12 Pattern (R1C1): =R[-1]C*AvgSalary/12 Reads: Assumptions!B9, Costs!B3, name AvgSalary """ costs = book['Costs'] for c in range(2, 14): costs[4, c] = costs[3, c] * book.name('AvgSalary') / 12 def rent(book: Book) -> None: r"""Rent Costs!B5:M5 (12 columns, copied across). Excel (B5): =MonthlyRent Pattern (R1C1): =MonthlyRent Reads: Assumptions!B10, name MonthlyRent """ costs = book['Costs'] for c in range(2, 14): costs[5, c] = book.name('MonthlyRent') def total_costs(book: Book) -> None: r"""Total costs Costs!B6:M6 (12 columns, copied across). Excel (B6): =SUM(B4:B5) Pattern (R1C1): =SUM(R[-2]C:R[-1]C) Reads: Costs!B4:B5 """ costs = book['Costs'] for c in range(2, 14): costs[6, c] = xl.SUM(costs.rng(4, c, 5, c))