For loop in excel

Brix23

New Member
Joined
Nov 15, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Dear all,

I am having issues creating an equation. I would need to perform an iteration of an equation, namely, everything stays fixed except for one variable which changes in descending order. The output of this calculation is saved the equation is run one more time and the result is again saved. After x amount of times, the results from each equation will be summed together.

So for instance:

((1+r)^n *(1+h)^n) where n changes from i = 6 to i =1. For every run the result is saved and then at the end summed up sum((((1+r)^n *(1+h)^n),(1+r)^n-1 *(1+h)^n-1),....)

I would want to avoid VBA and do it in an equation does anyone know how this could be done?

Best,
Tilen
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABC
1
2i655986
3r1
4n2
Data
Cell Formulas
RangeFormula
C2C2=REDUCE(0,SEQUENCE(B2,,B2,-1),LAMBDA(a,b,a+(1+B3)^b*(1+B4)^b))
 
Upvote 0
I was not expecting such a fast answer. Thank you so much.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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