I have searched Google and stack exchange extensively and cannot find a solution that fits my needs.
I have a recursive formula in a Google Spreadsheet that can be represented as
F(0) = 0
F(1) = 5000
F(n) = F(n-1) + ((n-1) * 5000)
I can effectively calculate this with a long two column table with n values in column A and the recursive formula in column B which references the previous cell when needing to access F(n-1).
This approach is clunky, takes up space, and requires a separate table for every different calculation. In my sheet I need to calculate this formula for different values of F(0)
and it requires a separate table for each one.
What I want is a simple single cell with a formula that references another cell for the n value and calculates the result recursively all in the background, instead of taking up a whole set of space in a table somewhere in my sheet for it to do the recursion through multiple cells.
My spreadsheet to make it clearer:
Is this possible?
F(1)=5000
does not follow your declaration forF(n)
(which should return 0 for n=1 and 5000 for n=2) I'm assuming that means you'll be individually defining F(0) and F(1) in cells without a formula. In other words, the formulaF(n)
doesn't need to accept any n value less than 2. Is this correct?