"""Formulas from sheet 'RateCard' of 'pricing_calculator.xlsx' (pandas target). Generated by Power Migrate 0.1.0a1. Copied formulas are column, row or table operations on the sheet's DataFrame; other blocks run cell by cell over the same frame. ``model.compute`` runs them in dependency order. """ from .. import xl from ..frames import FrameBook, abs_, across, and_, average, averageif, averageifs, ceiling, cells, choose, col, concat, concatenate, count, counta, countblank, countif, countifs, date, datedif, day, div, edate, eomonth, eq, exact, exp, find, floor, fv, ge, gt, hlookup, iferror, ifna, ifs, index, int_, ipmt, irr, isblank, iserr, iserror, islogical, isna, isnumber, istext, le, left, len_, ln, log, log10, lower, lt, match, max_, maxifs, mid, min_, minifs, mod, month, n, ne, networkdays, not_, nper, npv, num, or_, pi, pmt, power, ppmt, product, proper, pv, rate, rept, right, round_, rounddown, roundup, search, shifted, sign, sqrt, substitute, sum_, sumif, sumifs, sumproduct, switch, text, textjoin, trim, trunc, upper, value, vlookup, weekday, where, workday, xlookup, xor, year, yearfrac def selected_margin_bps(book: FrameBook) -> None: r"""Selected margin (bps) RateCard!B10 (one cell). Excel (B10): =INDEX(B3:F7,MATCH(Inputs!B9,A3:A7,0),MATCH(Inputs!B5,B2:F2,0)) Reads: Inputs!B5, Inputs!B9, RateCard!B2:F2, RateCard!A3:A7, RateCard!B3:F7 """ rate_card = book['RateCard'] inputs = book['Inputs'] rate_card["B10"] = xl.INDEX(rate_card["B3:F7"], xl.MATCH(inputs["B9"], rate_card["A3:A7"], 0), xl.MATCH(inputs["B5"], rate_card["B2:F2"], 0)) def base_rate(book: FrameBook) -> None: r"""Base rate RateCard!B11 (one cell). Excel (B11): =_xlfn.XLOOKUP(Inputs!B5,H3:H7,I3:I7,"n/a") Reads: Inputs!B5, RateCard!H3:H7, RateCard!I3:I7 """ rate_card = book['RateCard'] inputs = book['Inputs'] rate_card["B11"] = xl.XLOOKUP(inputs["B5"], rate_card["H3:H7"], rate_card["I3:I7"], 'n/a') def customer_apr(book: FrameBook) -> None: r"""Customer APR RateCard!B12 (one cell). Excel (B12): =B11+B10/10000 Reads: RateCard!B10, RateCard!B11 """ rate_card = book['RateCard'] rate_card["B12"] = rate_card["B11"] + rate_card["B10"] / 10000 def monthly_rate(book: FrameBook) -> None: r"""Monthly rate RateCard!B13 (one cell). Excel (B13): =B12/12 Reads: RateCard!B12 """ rate_card = book['RateCard'] rate_card["B13"] = rate_card["B12"] / 12