# Help with complicated math and syntax

I am trying to create a calculator for this mobile game that I play (Lord’s Mobile) but cant seem to figure out the formula.

1) In this game, you can get your upgrade time reduced when your guild members press a “help” button.

2) A single “help” reduces your current time by 1%. So if someone presses help, your time (X) = (Time-(Time*0.1)). When another person presses help, it would be Y = (X-(X*0.1)), then Z=(Y-(Y*0.1)), so on and so forth, where each new letter represents the new time.

Another example: If your total time is 24 hours (1,444 minutes):

• Help 1 would be (1,444-(1,444*0.1)=1,300min left;

• Help 2 would be (1,300-(1,300*0.1)=1,170min left (and so on).

3) There is a minimum (or maximum?): Once 1 minute > 1%, it reduces by 1 minute instead.

4) Castles can be levels 1-25. The amount of helps you can receive depends on your castle level. The amount increases consecutively, with Lvl 1 being 5 times, and 25 being 30 times.

With all of these factors, I can’t seem to figure out how to calculate this in my spreadsheet. Even without the additional factors, I was at least trying to figure out how to do the whole “1% Reduction” in one cell.

I was hoping some math genius might see this. And even without the math help, I’m posting this here because I don’t know the correct syntax. Anyone have a clue as to what to do? Thanks!

• Hello @Sara, it doesn't look like you need a math genius but a dev. Your need is a conditionnal formula with `=IF`; Don't hesitate to share a sample with desired results, conditions, etc.. for us to better understand and help you. Moreover there are a lot of communities out there for this game and i'm sure someone already made this kind of spreadsheet. I found this : docs.google.com/spreadsheets/d/…
– pjmg
Aug 10, 2019 at 7:42
• Stop thinking about spreadsheets, they are not the tool for this. This is just programming code and needs a programming language. In that context, spreadsheets can be at most a tool to prototype or illustrate something. So that makes this a programming question, but I'm unsure if it belongs on Stack Overflow or Software Engineering (probably the latter, it's purely an algorithm issue). If you place is there it needs more effort like Paul suggested.
– user55949
Aug 11, 2019 at 11:48

You have a few problems in your examples: 24 hours is 1440 minutes.

Also you say 1% but then your example shows that you are calculating a 10% reduction.

• If you want a 10% reduction just multiply x*0.9
• if it is a 1% reduction just multiply x*0.99

3) There is a minimum (or maximum?): Once 1 minute > 1%, it reduces by 1 minute instead.

you need to include an if statement. assuming the previous value is in cell b7

for a 1% reduction:

``````   =if(b7<100,b7-1,b7*0.99)
``````

for a 10% reduction

``````   =if(b7<10,b7-1,b7*0.9)
``````

4) Castles can be levels 1-25. The amount of helps you can receive depends on your castle level. The amount increases consecutively, with Lvl 1 being 5 times, and 25 being 30 times.

I have no idea what that means in relation to the previous requirements.