views:

18

answers:

2

Here's what's currently happening:

Z8:   100
Z9:   =((Z8*W2)+Z8)
Z10:  =Z9*X2+Z9
Z11:  =Z10*Y2+Z10

I start with a value of 100 and then add data from W2, X2 and Y2. This works, but it spans across three cells. I need it to fit into one.

I'm drawing a blank on nesting the equations to fit into the one. Help?

A: 

=(((Z8*W2+Z8)*X2+(Z8*W2+Z8)))*Y2+(((Z8*W2+Z8)*X2+(Z8*W2+Z8)))

This seems to work ok

Frank
+2  A: 

First factor out common terms:

Z8:   100
Z9:   =((Z8*W2)+Z8) = Z8*(W2+1)
Z10:  =Z9*X2+Z9 = Z9*(X2+1)
Z11:  =Z10*Y2+Z10 = Z10*(Y2+1)

Then substitute each term into the equation:

Z9  = Z8*(W2+1) 
Z10 = Z9*(X2+1) = Z8*(W2+1)*(X2+1)
Z11 = Z10*(Y2+1) = Z8*(W2+1)*(X2+1)*(Y2+1)

And there's your answer

Konerak
Your solution looks much nicer. Cheers.
Frank
Not only nicer, but this approach will cause each element to be calculated only once (think of a recursive algorithm without caching) (although I suspect Excel is smarter than that :)) and it's easier to read and maintain.
Konerak