Add growth to formula that uses structured [Table] references

kcmuppet

Active Member
Joined
Nov 2, 2005
Messages
439
Office Version
  1. 365
Platform
  1. Windows
Hello experts,

I've got a IFS formula that spreads costs in different ways according to what is selected in a table next to the cells containing the formulae

(row 6 contains the first day of the month, row 7 the last day and 8 the year and month only)

Forecast Model Example.xlsx
DEFGHIJK
91May-23Jun-23Jul-23
92Annual Growth rateRepeatsStartEndAmount
1020%End of quarter01 May 2331 Dec 26£ 5,000-5,000-
Total OpEx
Cell Formulas
RangeFormula
I91:K91I91=I$6
F102F102=ForecastStartDate
I102I102=IFS( t_Ex_Services[@Repeats]="All months", t_Ex_Services[@Amount], t_Ex_Services[@Repeats]="Every month in range", IF(AND(t_Ex_Services[@Start]<=I$6,t_Ex_Services[@End]>=I$7),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Odd months", IF(ISODD(MONTH(I$8)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Even months", IF(ISEVEN(MONTH(I$8)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="End of quarter", IF(OR(MONTH(I$8)=3,MONTH(I$8)=6,MONTH(I$8)=9,MONTH(I$8)=12),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Repeats annually", IF(MONTH(I$8)=MONTH(t_Ex_Services[@Start]),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Spread over period", IF(AND(t_Ex_Services[@Start]<=I$6,t_Ex_Services[@End]>I$7),I$5*(t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start]+1)),IF(AND(t_Ex_Services[@Start]>I$6,t_Ex_Services[@Start]<=I$7),(I$7-t_Ex_Services[@Start]+1)*(t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start]+1)),IF(AND(t_Ex_Services[@End]>=I$6,t_Ex_Services[@End]<=I$7),(t_Ex_Services[@End]-I$6+1)*(t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start]+1)),0))), t_Ex_Services[@Repeats]="", "")
J102:K102J102=IFS( t_Ex_Services[@Repeats]="All months", t_Ex_Services[@Amount], t_Ex_Services[@Repeats]="Every month in range", IF(AND(t_Ex_Services[@Start]<=J$6,t_Ex_Services[@End]>=J$7),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Odd months", IF(ISODD(MONTH(J$8)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Even months", IF(ISEVEN(MONTH(J$8)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="End of Quarter", IF(OR(MONTH(J$8)=3,MONTH(J$8)=6,MONTH(J$8)=9,MONTH(J$8)=12),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Repeats annually", IF(MONTH(J$8)=MONTH(t_Ex_Services[@Start]),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Spread over period", IF(AND(t_Ex_Services[@Start]<=J$6,t_Ex_Services[@End]>J$7),J$5*(t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start]+1)),IF(AND(t_Ex_Services[@Start]>J$6,t_Ex_Services[@Start]<=J$7),(J$7-t_Ex_Services[@Start]+1)*(t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start]+1)),IF(AND(t_Ex_Services[@End]>=J$6,t_Ex_Services[@End]<=J$7),(t_Ex_Services[@End]-J$6+1)*(t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start]+1)),0))), t_Ex_Services[@Repeats]="", "")
Named Ranges
NameRefers ToCells
ForecastStartDate=Assumptions!$C$6F102


How can I adapt this to take account of an annual growth rate (in column D)?

For example, if the user selects, "All months", it would grow like illustrated below:


Forecast Model Example.xlsx
DEFGHIJK
92Annual Growth rateRepeatsStartEndAmount
1005%All months£ 1,0001,0041,0081,012
Total OpEx
Cell Formulas
RangeFormula
I100:K100I100=H100*(1+t_Ex_Services[@[Annual Growth rate]])^(1/12)



Is there a way to make the formula keep the ability to use the [@Amount] reference rather than use the unstructured reference in the example above?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Do you just mean something like this ?

20230506 Compounding increase kcmuppet.xlsx
DEFGHIJK
92Annual Growth rateRepeatsStartEndAmount
1000.05All months10001,0041,0081,013
Sheet1
Cell Formulas
RangeFormula
I100:K100I100=(1+t_Ex_Services[@[Annual Growth rate]]/12)^COLUMNS($I100:I100)*t_Ex_Services[@Amount]
 
Upvote 0
Hi, thanks for your reply.

No, I'm trying to change the existing formulae in the columns to the right of column H (for each month) so that they take account of/factor in the growth rate in column D.

For example, if in column E they select "Odd months", and the amount is 1000, the current formulae puts 1000 in alternate columns (I, K, and so on), and zero in the other columns.
What I'd like it to do is take account of the % growth in column D. So if column D is 5%, column E is "Odd months" then column I would be 1000, J would be 0, K would be 1008.16, L 0, M 1016.4, etc.
 
Upvote 0
I am guessing a bit here but does this help ?

20230506 Compounding increase kcmuppet.xlsx
DEFGHIJKLM
92Annual Growth rateRepeatsStartEndAmount
990.05All months10001,0001,0041,0081,0131,017
1000.05Odd Months10001,00001,00801,017
Sheet1
Cell Formulas
RangeFormula
I99:M100I99=LET(compX,(1+t_Ex_Services[@[Annual Growth rate]]/12)^(COLUMNS($I99:I99)-1)*t_Ex_Services[@Amount], IF(t_Ex_Services[@Repeats]="Odd Months",ISEVEN((COLUMNS($I99:I99)-1))*compX,compX))
 
Upvote 0
I'm not sure if you're suggesting adding supplementary rows (which I'd prefer to avoid).

Perhaps it's easier to explain with a clean sheet with the dates rows at the top, and examples of each. In the below, rows 17-22 show what I'd like the results to be in rows 10 to 15 if the values in D10:D15 were all 5%. Ideally, I'd like to achieve that by modifying the formula in I10 so that it can be filled right and down to U15, while keeping the use of the structured references to the table, so that somebody I can work out what is going on with each of the IFS conditions easily

Book4.xlsx
DEFGHIJKLMNO
6Start01 May 2301 Jun 2301 Jul 2301 Aug 2301 Sep 2301 Oct 2301 Nov 23
7End31 May 2330 Jun 2331 Jul 2331 Aug 2330 Sep 2331 Oct 2330 Nov 23
8May 23Jun 23Jul 23Aug 23Sep 23Oct 23Nov 23
9Annual Growth rateRepeatsStartEndAmount
100%All months£ 1,0001,0001,0001,0001,0001,0001,0001,000
110%Odd months£ 1,0001,000-1,000-1,000-1,000
120%End of quarter£ 1,000-1,000--1,000--
130%Repeats annually01 May 23£ 1,0001,000------
140%Spread over period01 Jul 2331 Jan 24£ 1,000--140145140145140
150%Every month in range06 Oct29 Feb 24£ 1,000------1,000
16Desired outcome below (taking account of growth rate in column D
175%All months£ 1,0001,0001,0041,0081,0121,0161,0211,025
185%Odd months£ 1,0001,000-1,008-1,016-1,025
195%End of quarter£ 1,000-1,004--1,016--
205%Repeats annually£ 1,0001,000------
215%Spread over period01 Jul 2331 Jan 24£ 1,000--141146.64142.49147.83143.65
225%Every month in range06 Oct29 Feb 24£ 1,000------1,025
Sheet1
Cell Formulas
RangeFormula
I10:O10I10=IFS( t_Ex_Services[@Repeats]="All months", t_Ex_Services[@Amount], t_Ex_Services[@Repeats]="Every month in range", IF(AND(t_Ex_Services[@Start]<=I$6,t_Ex_Services[@End]>=I$7),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Odd months", IF(ISODD(MONTH(I$6)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Even months", IF(ISEVEN(MONTH(I$6)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="End of quarter", IF(OR(MONTH(I$6)=3,MONTH(I$6)=6,MONTH(I$6)=9,MONTH(I$6)=12),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Repeats annually", IF(MONTH(I$6)=MONTH(t_Ex_Services[@Start]),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Spread over period", t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start])*(I$6=MEDIAN(EOMONTH(t_Ex_Services[@Start],-1)+1,EOMONTH(t_Ex_Services[@End],0),I$6))*(MIN(t_Ex_Services[@End],EOMONTH(I$6,0))-MAX(t_Ex_Services[@Start],I$6-1)), t_Ex_Services[@Repeats]="", "")
I11:O15I11=IFS( t_Ex_Services[@Repeats]="All months", t_Ex_Services[@Amount], t_Ex_Services[@Repeats]="Every month in range", IF(AND(t_Ex_Services[@Start]<=I$6,t_Ex_Services[@End]>=I$7),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Odd months", IF(ISODD(MONTH(I$8)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Even months", IF(ISEVEN(MONTH(I$8)),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="End of quarter", IF(OR(MONTH(I$8)=3,MONTH(I$8)=6,MONTH(I$8)=9,MONTH(I$8)=12),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Repeats annually", IF(MONTH(I$8)=MONTH(t_Ex_Services[@Start]),t_Ex_Services[@Amount],0), t_Ex_Services[@Repeats]="Spread over period", t_Ex_Services[@Amount]/(t_Ex_Services[@End]-t_Ex_Services[@Start])*(I$6=MEDIAN(EOMONTH(t_Ex_Services[@Start],-1)+1,EOMONTH(t_Ex_Services[@End],0),I$6))*(MIN(t_Ex_Services[@End],EOMONTH(I$6,0))-MAX(t_Ex_Services[@Start],I$6-1)), t_Ex_Services[@Repeats]="", "")
F13F13=ForecastStartDate


That's all the Xl2BB tool will allow me to post, but here's a picture that shows the rest of the existing vs desired results.

1683397233400.png
 
Upvote 0
Assuming your XL2BB references are accurate try this in I10 (columns letter I row 10).
Then copy it down and across.
The basic concept is that your IF statements will return 1 or 0 and multiply that by the value calculation in in compX being the compounding monthly amount.
( I don't think it works as is for the spread over period option)


Excel Formula:
=LET(compX,(1+t_Ex_Services[@[Annual Growth rate]]/12)^(COLUMNS($I9:I9)-1)*t_Ex_Services[@Amount],
compX*IFS(
t_Ex_Services[@Repeats]="All months",
1,

t_Ex_Services[@Repeats]="Every month in range",
IF(AND(t_Ex_Services[@Start]<=I$6,t_Ex_Services[@End]>=I$7),1,0),

t_Ex_Services[@Repeats]="Odd months",
IF(ISODD(MONTH(I$6)),1,0),

t_Ex_Services[@Repeats]="Even months",
IF(ISEVEN(MONTH(I$6)),1,0),

t_Ex_Services[@Repeats]="End of quarter",
IF(OR(MONTH(I$6)=3,MONTH(I$6)=6,MONTH(I$6)=9,MONTH(I$6)=12),1,0),

t_Ex_Services[@Repeats]="Repeats annually",
IF(MONTH(I$6)=MONTH(t_Ex_Services[@Start]),1,0),

t_Ex_Services[@Repeats]="Spread over period",
1/(t_Ex_Services[@End]-t_Ex_Services[@Start])*(I$6=MEDIAN(EOMONTH(t_Ex_Services[@Start],-1)+1,EOMONTH(t_Ex_Services[@End],0),I$6))*(MIN(t_Ex_Services[@End],EOMONTH(I$6,0))-MAX(t_Ex_Services[@Start],I$6-1)),

t_Ex_Services[@Repeats]="",
0))
 
Upvote 1

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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