LAMBDA · Financial

Mortgage schedule LAMBDA

xl.mortgage.schedule spills month, payment, interest, principal, and balance for a fixed-rate US loan. A $1,200 six-month example is small enough to audit.

Microsoft 365, Excel 2024, and Excel for the web. Excel 2021 does not have LAMBDA.

Syntax =xl.mortgage.schedule(principal, annual_rate, years)

xl.mortgage.schedule
=LAMBDA(principal, annual_rate, years,
  LET(
    n, years * 12,
    r, annual_rate / 12,
    pmt, PMT(r, n, -principal),
    k, SEQUENCE(n),
    opening, principal * (1 + r) ^ (k - 1) - pmt * ((1 + r) ^ (k - 1) - 1) / r,
    interest, opening * r,
    principal_paid, pmt - interest,
    balance, opening - principal_paid,
    HSTACK(k, pmt + 0 * k, interest, principal_paid, balance)
  )
)

Arguments

NameRequiredWhat to pass
principalRequiredAmount borrowed, as a positive number. On a home purchase that is the price minus the down payment.
annual_rateRequiredAnnual note rate, such as 6.25% or 0.0625. This is not the APR.
yearsRequiredTerm in years. The schedule has years × 12 rows and assumes a payment at the end of each month.

Examples

A six-month loan you can audit by hand

=xl.mortgage.schedule(1200, 12%, 0.5)

Result Payment $207.06. Month 1 interest $12.00, principal $195.06, balance $1,004.94.

=PMT($B$1/12,$B$2,-$B$3)B6
Six-month loan
ABCDE
1Annual rate12%
2Months6
3Amount$1,200.00
4
5MonthPaymentInterestPrincipalBalance
61$207.06$12.00$195.06$1,004.94
72$207.06$10.05$197.01$807.93
A picture of the sheet, not a live calculator. B1 stores 12% as 0.12. Month 1 is row 6.

xl.mortgage.schedule spills a fixed-rate amortization table. Use it when you want every month of a level payment, not just the single number from PMT. The $320,000, 6.25%, 30-year case on the PMT page is the same engine: the payment displays as $1,970.30, and month 1 is $1,666.67 interest and $303.63 principal.

The six-month picture is the one to audit. At 12% on $1,200, month 1 interest is exactly $12. The payment displays as $207.06. Principal is $195.06 and the balance displays as $1,004.94. Month 2 interest is $10.05 because it is 1% of that balance.

Add it to the workbook

Copy the formula in the block above, including the line breaks. Choose Formulas, Name Manager, New. Set the name to xl.mortgage.schedule, the scope to Workbook, and paste into Refers to. Excel Labs can do the same step: open the Advanced Formula Environment, add that name, and save it back to the workbook. A cell then calls =xl.mortgage.schedule(...).

The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA even when it already has XLOOKUP, FILTER, or LET.

How it works

n is the term in months and r is the monthly note rate. PMT is called with a negative principal so the payment comes back positive, matching the sign used on the PMT page. SEQUENCE builds the month numbers. Each opening balance is computed from the month number, not from the cell above, so a later month does not inherit a rounding error:

opening = principal × (1 + r) ^ (k − 1) − payment × ((1 + r) ^ (k − 1) − 1) / r

Interest is opening × r. Principal is payment − interest. The new balance is opening − principal. pmt + 0 * k exists only so HSTACK gets a payment column as tall as the month numbers. HSTACK will not repeat a single number on its own.

Limits

The note rate is not the APR. Property tax, insurance, and extra principal are not in the schedule. A 0% loan divides by zero here, even though PMT itself accepts a zero rate. Currency formatting shows cents. The last balance is zero before that rounding. Anything left is floating-point dust.

The same two rows can be built without a LAMBDA. With the rate in B1, the month count in B2, and the amount in B3:

=PMT($B$1/12, $B$2, -$B$3)

=IPMT($B$1/12, A6, $B$2, -$B$3)

=PPMT($B$1/12, A6, $B$2, -$B$3)