0
In my spreadsheet I have two numbers, start_number
and nr_iterations
. I'm looking for an formula that returns a series of numbers starting with start_number - 1
and nr_iterations
long (each following item with the value of one lower).
So like this:
(nr_iterations, start_number) => [my_number_serie]
(0, 1) => []
(1, 3) => [2]
(2, 5) => [4, 3]
(3, 7) => [6, 5, 4]
(4, 9) => [8, 7, 6, 5]
Basically, start_number is also calculated, but probably is not too important:
start_number = 1 + nr_iterations*2
I'm actually interested in the SUM
of this serie numbers, if that's of any help.
That's it. And thanks for the explanation how to sum up the first n integer. It can actually be rewritten to
[C1] =(3*A1*A1+A1)/2
so you don't need[B1]
, but your example is more clear. – doekman – 2019-01-05T20:02:01.263I did realise that, but I left it as I did so as to show the logic of the calculation, as well as allowing for different upper bounds to the range. – AFH – 2019-01-05T20:35:26.993
Hmm, I don't get it completely. If we break the formula from C1 into
[D1] = B1*(B1-1)/2
and[E1] =A1*(A1+1)/2
, so we can redefine[C1] = D1-E1
. In this,E1
isSUM(1..A1)
, but what isD1
? – doekman – 2019-01-06T17:37:19.187D1
isSUM(1..B1)-B1
, ieSUM(1..(B1-1))
. Another way to see the formula is to substituteB1-1
for n in *n(n+1)/2**. – AFH – 2019-01-06T17:56:45.827