Formula to repeat a value starting at x year and repeating y years

Robert Davidson

New Member
Joined
Aug 8, 2023
Messages
29
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I am preparing a cashflow model which has a column with years starting at say 2023 going on for several decades. I wish to make a periodic income in the adjacent column that starts in say 2025 then repeats every say 3 years. Could someone help construct a formula for this? The start year, the income, the first income year and the frequency all need to be variables. An example would be. The aim is to produce a periodic income for a NPV calculation arising from felling trees so the frequency could be up to perhaps 120 years.

YearIncome
20230
20240
20251000
20260
20270
20281000
20290
20300
20311000
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Welcome to the MrExcel board!

Is this the sort of thing you mean?

23 08 09.xlsm
ABCDE
1Start2023YearIncome
2Years4020230
3Repeat Yrs320240
4Amount100020251000
5First Income202520260
620270
720281000
820290
920300
1020311000
1120320
1220330
1320341000
1420350
1520360
1620371000
1720380
1820390
1920401000
2020410
2120420
2220431000
2320440
2420450
2520461000
2620470
2720480
2820491000
2920500
3020510
3120521000
3220530
3320540
3420551000
3520560
3620570
3720581000
3820590
3920600
4020611000
4120620
42
Cashflow
Cell Formulas
RangeFormula
D2:E41D2=LET(s,SEQUENCE(B2,,B1),HSTACK(s,BYROW(s,LAMBDA(y,IF(AND(y>=B5,MOD(y-B5,B3)=0),B4,0)))))
Dynamic array formulas.
 
Upvote 1
That is exactly what I wanted so thank you very much. If I wanted to add in another column to discount the income could that be included in this formula. The calculation would be “income/(1+r)^(year of income-start year)”. The variable r could be, for example, 0.05 i.e. 5%.
 
Upvote 0
Could you show us some sample data with the expected results manually filled in & explain the calculations in relation to that sample data?
 
Upvote 0
Here's an example.
Model start year 2023
First income year 2025
Repeat yrs 3
Income 1000
Discount rate (r) 5%

In the Discounted column the formula would be: =Income/(1+r)^(Income year-Model Start Year)
So for the income in 2028 the numbers would be 1000/(1+.05)^(2028-2023) = 783.53. It's probably best to round to 2 decimal places.
I would then sum the entire discounted column separately to derive the Present Value of the cash flow.
YearIncomeDiscounted
202300
202400
20251000907.03
202600
202700
20281000783.53
202900
203000
20311000676.84
 
Upvote 0
Here's an example.
Thanks. Is this what you mean?

23 08 09.xlsm
ABCDE
1Start2023YearIncome
2Years4020230
3Repeat Yrs320240
4Amount10002025907.03
5First Income202520260
6Discount5%20270
72028783.53
820290
920300
102031676.84
1120320
1220330
132034584.68
1420350
1520360
162037505.07
1720380
1820390
192040436.3
2020410
2120420
222043376.89
2320440
2420450
252046325.57
2620470
2720480
282049281.24
2920500
3020510
312052242.95
3220530
3320540
342055209.87
3520560
3620570
372058181.29
3820590
3920600
402061156.61
4120620
Cashflow (2)
Cell Formulas
RangeFormula
D2:E41D2=LET(s,SEQUENCE(B2,,B1),HSTACK(s,BYROW(s,LAMBDA(y,IF(AND(y>=B5,MOD(y-B5,B3)=0),ROUND(B4/(1+B6)^(y-B1),2),0)))))
Dynamic array formulas.
 
Upvote 1
That is perfect. Many thanks for all your help. I have learnt a load more formulae as a result.
 
Upvote 0
You're welcome. Glad to help. Thanks for the follow-up. :)
 
Upvote 0
May I trouble you again as I have taken this formula further? Traditionally one shows undiscounted income and costs in separate columns (see picture - columns E & F) then the sum of these two columns are discounted and shown in column G. How do I get the -3500 in F5, for example, to be discounted and shown in G5? The value in G5 would be -3299.08.

The formula in D3 is:
=LET(s,SEQUENCE(B3,,B2),HSTACK(s,BYROW(s,LAMBDA(y,IF(AND(y>=B6,IF(ISBLANK(B7),B2+B3,y<=B7),MOD(y-B6,B4)=0),B5,0))),BYROW(s,LAMBDA(y,IF(AND(y>=B6,IF(ISBLANK(B7),B2+B3,y<=B7),MOD(y-B6-B9,B4)=0),-B8,0))),BYROW(s,LAMBDA(y,IF(AND(y>=B6,IF(ISBLANK(B7),B2+B3,y<=B7),MOD(y-B6,B4)=0),ROUND(B5/(1+B11)^(y-B2),2),0)))))


Excelpic.png
 
Upvote 0
Can you show that sample data again but with the first 12 rows of results manually filled in with the desired results and explain how you get the figures in the 'Discounted' column?
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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