Reputation: 107
I have a stream of cash flow numbers as shown in picture:
Is there any possible way to change the sum range of G9
by changing the value of D9
? For example, if I change D9
's value to 5, I want the formula in G9
to automatically change to =SUM(C6:G6)
.
I know VBA can do this, but I don't want to use VBA since some of my colleagues don't like it. Is there any way to use some formula tricks to do it?
Upvotes: 1
Views: 4965
Reputation:
try,
'volatile OFFSET method
=SUM(OFFSET(C6, 0, 0, 1, D9))
'non-volatile INDEX method
=SUM(C6:INDEX(C6:L6, 1, D9))
Upvotes: 3