Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Repeat Addition

Status
Not open for further replies.

johnie50

IS-IT--Management
Jul 8, 2011
1
GB
Hi, i have a formula where i need to do some sort of repeat notification. For example say i wanted 2 repitions i would look like:

= (C12 * C9 + C11) * C9 + C11

And 3 would look like:

= ((C12 * C9 + C11) * C9 + C11) * C9 + C11

And so on. I'm not sure how this can be done and i've confused myself so much that i thought i would ask for help.

Thanks
 


hi,

What's the business case for this exercise?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I think what you're doing is taking a value X, multiplying it by something A and adding something B, and then using this as the new value X for the next repetition. Two ways to do this.

(1) Assuming you'd like a table for values corresponding to increasing repetitions:
Put the first formula where you want, say in A1: (C12 * C9 + C11) * C9 + C11
Put the formula =(A1 * $C$9) + $C$11 in the cell below, and copy down. This way each line takes the previous result, and you never have to type the whole thing.

(2) There is also an analytical solution. I put my values for A, B, and X in cells B1..B3, in which case the solution is:
=(POWER($B$1, A7)*$B$3) + (POWER($B$1, A7)-1)/($B$1-1)*$B$2
where cell A7 contains the number of repetitions desired.
The solution is based on the idea of expanding to:
(a^n)X + B(A^(n-1) + A^(n-2)...1)

These two methods give the same result up to 8 repetitions where I assumed my algebra was right, and stopped!
 


...which was the reason for my question. ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top