# Excel RPG Battle Math Issue

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I’m working in Excel and I’m trying to do battle processing math in the design doc stage. The trouble i'm having is that I’m trying to work out the percentage difference between two numbers so i know how much Attack power i need to remove from an attacking party. Long and short of it is that i having two numbers: X Agility Stat of A - Y Agility Stat of B And i want to know how much X is of Y in percent, i.e. if X was 100 and Y was 200 then Z would be 50%. What i've currently got is the following in two cells (Cell3 and Cell4) while Cell1 and Cell2 are X and Y: =IF(Cell1=Cell2, 50, IF(Cell1>Cell2, ((Cell2/Cell1)*100)/2, 100-Cell4)) =IF(Cell1=Cell2, 50, IF(Cell1<Cell2, ((Cell1/Cell2)*100)/2, 100-Cell3)) This should make it so that if Cell1 is grater than Cell2 that it gives me the percentage of Cell2 from Cell1, if Cell1 is less than Cell2 that it gives me the percentage of Cell1 from Cell2. The last part of the IF statements make it so that if Cell1 is not grater than Cell2 or vice verse respectively that it just makes the opposite percentage value in its respective cell. What this little set also dose is generate a limiter, i.e. if A is twice as high as B then the percent returned 100% in Cell3 and 0% in Cell4 and vice versa so someone who is twice as slow as their target cant hope to hit it and if they are twice as fast can rest assured that they will never miss. The problem I’m having is that although it returns the right answer if you are twice as fast as your target, when i make the target twice as fast as you, the dam equation comes back at me with a 75% chance of hitting it which is just wrong. Can anyone see something i can’t? Siolis

##### Share on other sites
Nvr mind, i fixed it, i just had to switch the cell division. =]

Siolis

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633708
• Total Posts
3013472
×