Home > Software design >  I need to sum up the numbers between two and a cell's value, then multiply it by another value
I need to sum up the numbers between two and a cell's value, then multiply it by another value

Time:11-14

I'm working on an RPG project, and want to get a preview of how costs will shake out.

The plan is for every raise of an attribute, you pay its new value times 9.

Going from 1 to 2 costs 18 XP.

If you wish to go from 1 to 4, you need to pay (2x9) (3x9) (4x9), or (9x9), 72.

I want to be able to punch in 9 for an attribute in my google sheet, and have it able get to the 44x9 needed to get the 396 cost to get that. Is there an easy way to do this I'm not seeing?

I looked at the Sum function, thinking I could set up an array (add all numbers between 2 and the value of the cell named Will) but the parsing doesn't work that way. I'm going all crosseyed, and feel that the answers either right in front of me, or is no.

CodePudding user response:

multiplies of 9 as array can be achieved like this:

=INDEX(SEQUENCE(44)*9)

CodePudding user response:

For any current value to any new value:

=sum(sequence(new_value-current_value,1,(current_value 1)*9,9))
  • Related