AMORTIZE

AMORTIZE(balance,int_rate_pct,periods)
balance
starting amount
int_rate_pct
annual rate of interest
periods
number of periods/pmts

Creates a simple amortization schedule

tboulden

Board Regular
Joined
Jan 14, 2021
Messages
73
Office Version
  1. 365
Platform
  1. Windows
A simple amortization schedule generator that leverages SCAN and MAKEARRAY. Using CHOOSE and MAKEARRAY, we can create an array of LAMBDAs to index sequential manipulations, then SCAN from starting value across the array of LAMBDAs. Once we have our basic amortization, we break out into a table to capture the details: beginning balance, interest, principal, ending balance. Finally, use MAKEARRAY to add periods column.

The big thing here is using CHOOSE to create an array of LAMBDAs as it can be used with MAP, REDUCE, SCAN in different ways. For example, can create an array of LAMBDAs that are commonly applied sequentially, and compose them together, i.e. define COMPOSE=LAMBDA(f,g,LAMBDA(x,g(f(x)))) then REDUCE(,CHOOSE({1,2,3},f,g,h),COMPOSE) is equivalent to LAMBDA(x,h(g(f(x)))).

Excel Formula:
=LAMBDA(balance,int_rate_pct,periods,
    LET(
        bal,NUMBERVALUE(balance),
        rate_,int_rate_pct/12,
        pmt_,PMT(rate_,periods,-balance),
        select_array,
            MAKEARRAY(periods,3,LAMBDA(i,j,j)),
        fxns,
            CHOOSE(select_array,
                LAMBDA(x,x),
                LAMBDA(x,x*(1+rate_)),
                LAMBDA(x,x-pmt_)
            ),
        amort,SCAN(bal,fxns,LAMBDA(prior,fn,fn(prior))),
        table,MMULT(amort,TRANSPOSE({1,0,0;-1,1,0;-1,0,1;0,0,1})),
        MAKEARRAY(periods,5,
            LAMBDA(i,j,IF(j=1,i,INDEX(table,i,j-1)))
        )
    )
)

LAMBDA_COMPOSE.xlsx
ABCDEFGH
1PeriodBegBalIntPrinEndBal
2Balance100,0001100,000.00416.67-8,144.0891,855.92
3Rate5%291,855.92382.73-8,178.0283,677.90
4Periods12383,677.90348.66-8,212.0975,465.81
5475,465.81314.44-8,246.3167,219.51
6567,219.51280.08-8,280.6758,938.84
7658,938.84245.58-8,315.1750,623.67
8750,623.67210.93-8,349.8242,273.85
9842,273.85176.14-8,384.6133,889.25
10933,889.25141.21-8,419.5425,469.70
111025,469.70106.12-8,454.6217,015.08
121117,015.0870.90-8,489.858,525.23
13128,525.2335.52-8,525.230.00
SCAN
Cell Formulas
RangeFormula
D2:H13D2=AMORTIZE(B2,B3,B4)
Dynamic array formulas.
 
Upvote 0
Updated to incorporate ACCUMULATE.

Excel Formula:
=LAMBDA(balance,int_rate_pct,periods,
      LET(
          bal,NUMBERVALUE(balance),
          rate_,int_rate_pct/12,
          pmt_,PMT(rate_,periods,-balance),
          fxns,
              CHOOSE({1,2,3},
                  LAMBDA(x,x),
                  LAMBDA(x,x*(1+rate_)),
                  LAMBDA(x,x-pmt_)
              ),
          amort,ACCUMULATE(bal,fxns,periods),
          table,MMULT(amort,TRANSPOSE({1,0,0;-1,1,0;-1,0,1;0,0,1})),
          MAKEARRAY(periods,5,
              LAMBDA(i,j,IF(j=1,i,INDEX(table,i,j-1)))
          )
      )
)
 

Forum statistics

Threads
1,224,837
Messages
6,181,255
Members
453,028
Latest member
letswriteafairytale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top