LET function and income stream table

Holger

New Member
Joined
Nov 22, 2017
Messages
27
Office Version
  1. 365
Platform
  1. MacOS
Hi there,

I want to update some spreadsheets with more modern formulas like the LET function. The task is to use the LET function to create a table that shows an income stream (=monthly withdrawals) from a savings account that earns interest. In the past I used endless formulas to create each col of the table.

Screen1 shows at the top input data (still needs removal of unnecessary fields) and at the bottom the old table.

Screen 2 is the new table I would like to create with the LET function. As you can see, first two works but rest not. Current LET function I use is as follows:
=LET(
openbal,E4,
annualrate,E7,
periodrate,annualrate/12,
pv,-openbal,
inflat,E16,
monthpers, EDATE(E5,SEQUENCE(H7,1,0)),
withdrawpmts,(1+inflat)*H6,
bals,SCAN(openbal,withdrawpmts,LAMBDA(x,r,x-r)),
intearnt, bals*periodrate,
VSTACK(
HSTACK("Month","Interest","Withdrawal","Remaining Balance"),
HSTACK(monthpers,intearnt,-withdrawpmts,balls)
))
For info, interest is previous period balance multiplied with monthly interest rate, while withdrawal is previous withdrawal multiplied with monthly inflation. I think what I cant work out is how to move forwardperiod by period. I managed to get the periods into the first column but rest does not work.
I'm clearly making some mistakes here so any help would be greatly appreciated.

Cheers everyone
 

Attachments

  • Screen1.png
    Screen1.png
    158.9 KB · Views: 4
  • Screen2.png
    Screen2.png
    34.6 KB · Views: 4

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I think this is what you're trying to do - running the balance down to nil?

It's a little convoluted, because with an inflation assumption we can't use the standard Excel financial functions.

ABCD
1Start21 Mar 2029
2Balance608,408.33
3N24
4p.a.p.m.
5Return5.0%0.417%
6Inflation3.5%0.292%
7
8DateInterestPaymentBalance
921 Mar 2029608,408.33
1021 Apr 20292,535.0325,822.28585,121.09
1121 May 20292,438.0025,897.59561,661.50
1221 Jun 20292,340.2625,973.13538,028.63
1321 Jul 20292,241.7926,048.88514,221.54
1421 Aug 20292,142.5926,124.86490,239.27
1521 Sep 20292,042.6626,201.05466,080.88
1621 Oct 20291,942.0026,277.47441,745.41
1721 Nov 20291,840.6126,354.12417,231.90
1821 Dec 20291,738.4726,430.98392,539.38
1921 Jan 20301,635.5826,508.07367,666.89
2021 Feb 20301,531.9526,585.39342,613.45
2121 Mar 20301,427.5626,662.93317,378.08
2221 Apr 20301,322.4126,740.70291,959.79
2321 May 20301,216.5026,818.69266,357.60
2421 Jun 20301,109.8226,896.91240,570.51
2521 Jul 20301,002.3826,975.36214,597.53
2621 Aug 2030894.1627,054.04188,437.65
2721 Sep 2030785.1627,132.95162,089.86
2821 Oct 2030675.3727,212.08135,553.15
2921 Nov 2030564.8027,291.45108,826.50
3021 Dec 2030453.4427,371.0581,908.89
3121 Jan 2031341.2927,450.8854,799.30
3221 Feb 2031228.3327,530.9527,496.68
3321 Mar 2031114.5727,611.250.00
34
Sheet1
Cell Formulas
RangeFormula
C5:C6C5=B5/12
A8:D33A8=LET(s,SEQUENCE(N),p,PMT((1+ret)/(1+inf)-1,N,-Balance)*(1+inf)^s,bal,VSTACK(Balance,Balance*(1+ret)^s-SCAN(0,p,LAMBDA(a,b,a*(1+ret)+b))),VSTACK({"Date","Interest","Payment","Balance"},HSTACK(Start,"","",Balance),HSTACK(EDATE(Start,s),DROP(ret*bal,-1),p,DROP(bal,1))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Balance=Sheet5!$B$2A8
inf=Sheet5!$C$6A8
N=Sheet5!$B$3A8
ret=Sheet5!$C$5A8
Start=Sheet5!$B$1A8

I've shown a small example (only 24 months) to fit on screen better. How do you calculate your initial withdrawal of 3,466.01? I get ...

Start21 Mar 2029
Balance608,408.33
N199
p.a.p.m.
Return5.0%0.417%
Inflation3.5%0.292%
DateInterestPaymentBalance
21 Mar 2029608,408.33
21 Apr 20292,535.033,464.10607,479.26
21 May 20292,531.163,474.21606,536.22
21 Jun 20292,527.233,484.34605,579.11
21 Jul 20292,523.253,494.50604,607.85
.....
21 Jul 2045101.276,112.7518,292.62
21 Aug 204576.226,130.5812,238.27
21 Sep 204550.996,148.466,140.80
21 Oct 204525.596,166.390.00
 
Upvote 0
Hi Stephen,

thanks very much for your assistance. I meanwhile worked out the interest column but not yet the withdrawal. Your above solution works great with 2 mods I would like to ask:

1. The initial withdrawal should be a simple input field, that I enter a $ value.
2. The withdrawals and interest should stop, once the remaining balance is 0

Again much appreciated your help.

Cheers H
 
Upvote 0
How about:

ABCD
1Start21 Mar 2029
2Balance100,000.00
3Payment4,000.00
4N26
5p.a.p.m.
6Return5.0%0.417%
7Inflation3.5%0.292%
8
9DateInterestPaymentBalance
1021 Mar 2029100,000.00
1121 Apr 2029416.674,000.0096,416.67
1221 May 2029401.744,011.6792,806.74
1321 Jun 2029386.694,023.3789,170.06
1421 Jul 2029371.544,035.1085,506.50
1521 Aug 2029356.284,046.8781,815.91
1621 Sep 2029340.904,058.6778,098.13
1721 Oct 2029325.414,070.5174,353.03
1821 Nov 2029309.804,082.3870,580.45
1921 Dec 2029294.094,094.2966,780.24
2021 Jan 2030278.254,106.2362,952.26
2121 Feb 2030262.304,118.2159,096.35
2221 Mar 2030246.234,130.2255,212.37
2321 Apr 2030230.054,142.2751,300.15
2421 May 2030213.754,154.3547,359.55
2521 Jun 2030197.334,166.4743,390.42
2621 Jul 2030180.794,178.6239,392.59
2721 Aug 2030164.144,190.8135,365.92
2821 Sep 2030147.364,203.0331,310.25
2921 Oct 2030130.464,215.2927,225.42
3021 Nov 2030113.444,227.5823,111.28
3121 Dec 203096.304,239.9118,967.66
3221 Jan 203179.034,252.2814,794.41
3321 Feb 203161.644,264.6810,591.37
3421 Mar 203144.134,277.126,358.38
3521 Apr 203126.494,289.602,095.28
3621 May 20318.734,302.11-2,198.09
37
Sheet1
Cell Formulas
RangeFormula
B4B4=ROUNDUP(NPER((1+ret)/(1+inf)-1,payment/(1+inf),-Balance),0)
C6:C7C6=B6/12
A9:D36A9=LET(s,SEQUENCE(N),p,payment*(1+inf)^(s-1),bal,VSTACK(Balance,Balance*(1+ret)^s-SCAN(0,p,LAMBDA(a,b,a*(1+ret)+b))),VSTACK({"Date","Interest","Payment","Balance"},HSTACK(Start,"","",Balance),HSTACK(EDATE(Start,s),DROP(ret*bal,-1),p,DROP(bal,1))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Balance=Sheet5!$B$2B4, A9
inf=Sheet5!$C$7B4, A9
N=Sheet5!$B$4A9
payment=Sheet5!$B$3B4, A9
ret=Sheet5!$C$6B4, A9
Start=Sheet5!$B$1A9
 
Upvote 1
Hi Stephen, thank you 🙏 so much. I was able to copy it into my file, named the ranges and voila, it is working perfectly. One major area I missed was, that I could enquiry about # of period with NPER formula.

Awesome help, thanks very much again.
 
Upvote 0
Stephen, in the 1st Hstack formula I replaced your “” with 0 as I use the resulting array later on in other formulas, which gave me #value errors. Once replaced those work as well.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,225,371
Messages
6,184,583
Members
453,244
Latest member
Todd Luet

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