Author Topic: Some Excel help?  (Read 2053 times)

0 Members and 1 Guest are viewing this topic.

Offline Cory Magel

  • Loremaster
  • ****
  • Posts: 5,629
  • OIC Points +5/-5
  • Fun > Balance > Realism
Some Excel help?
« on: March 06, 2013, 01:45:47 AM »
So, anyone that knows Excel and RM both well is probably going to understand what I am doing here...

I need to build a formula that will calculate skill totals.
So, how do I make a formula that says if the skill is 0 the total is equal to -15 and if the skill is 1 it is equal to three times that.  Obviously I'll change the numbers depending on the progression, but once I understand how I need to build it change the numbers should be simple enough.
- Cory Magel

Game design priority: Fun > Balance > Realism (greater than > less than).
(Channeling Companion, RMQ 1 & 2, and various Guild Companion articles author).

"The only thing I know about adults is that they are obsolete children." - Dr Seuss

Offline Defendi

  • Final Redoubt
  • **
  • Posts: 1,641
  • OIC Points +0/-0
  • Final Redoubt Press
    • Final Redoubt Press
Re: Some Excel help?
« Reply #1 on: March 06, 2013, 07:07:49 AM »
For the skill itself, I use a vertical lookup table on a data sheet elsewhere in the spread sheet.  It handles the progression of 0=-15, 1=3, 2=6 and you can also build the dimishing returns into it. The command is @vlookup.
The Echoes of Heaven:  Available for HARP and Rolemaster.  www.FinalRedoubt.com

Offline Defendi

  • Final Redoubt
  • **
  • Posts: 1,641
  • OIC Points +0/-0
  • Final Redoubt Press
    • Final Redoubt Press
Re: Some Excel help?
« Reply #2 on: March 06, 2013, 07:14:21 AM »
I guess in excel its =vlookup.
The Echoes of Heaven:  Available for HARP and Rolemaster.  www.FinalRedoubt.com

Offline markc

  • Elder Loremaster
  • ****
  • Posts: 10,697
  • OIC Points +0/-0
Re: Some Excel help?
« Reply #3 on: March 06, 2013, 07:42:42 AM »
A friend of mien used a series of if then statements, but =vlookup may be faster and consume less clock cycles.
MDC
Bacon Law: A book so good all PC's need to be recreated.
Rule #0: A GM has the right to change any rule in a book to fit their game.
Role Play not Roll Play.
Use a System to tell the story do not let the system play you.

Offline Merkir

  • Senior Adept
  • **
  • Posts: 667
  • OIC Points +0/-0
  • Long lost GM
    • Information Technology
Re: Some Excel help?
« Reply #4 on: March 06, 2013, 08:01:05 AM »
=IF(A1; 3*B1; B1)

Where:
cell A1 holds the skill value (0 or 1 in this case)
cell B1 holds the bonus/penalty value (-15 in this case)

Of course you can replace A1 and B1 with any other cell references, or simple constants if you like.

Offline Merkir

  • Senior Adept
  • **
  • Posts: 667
  • OIC Points +0/-0
  • Long lost GM
    • Information Technology
Re: Some Excel help?
« Reply #5 on: March 06, 2013, 08:09:01 AM »
=IF(A1; 3*B1; B1)

Where:
cell A1 holds the skill value (0 or 1 in this case)
cell B1 holds the bonus/penalty value (-15 in this case)

Of course you can replace A1 and B1 with any other cell references, or simple constants if you like.

Forgot to add, the above works in OpenOffice. For Excel, you'll probably need to replace the semicolons with commas. It probably has autocomplete anyway when you start typing IF(...

Offline Cory Magel

  • Loremaster
  • ****
  • Posts: 5,629
  • OIC Points +5/-5
  • Fun > Balance > Realism
Re: Some Excel help?
« Reply #6 on: March 06, 2013, 09:57:30 PM »
Cool, thank you all for the help.  I'll have to experiment with which is more optimal.

merkir, I think you might have misunderstood.
If the skill is 0 then the total should result in -15.
If the skill is 1 or higher than the skill should total 3x the skill.
What you have above results in a skill level of 3 being -15 when it should be 9.
- Cory Magel

Game design priority: Fun > Balance > Realism (greater than > less than).
(Channeling Companion, RMQ 1 & 2, and various Guild Companion articles author).

"The only thing I know about adults is that they are obsolete children." - Dr Seuss

Offline Cory Magel

  • Loremaster
  • ****
  • Posts: 5,629
  • OIC Points +5/-5
  • Fun > Balance > Realism
Re: Some Excel help?
« Reply #7 on: March 06, 2013, 10:24:21 PM »
So playing with it I think I have it.. I want...
=IF(A1=0, -15, IF(A1>0, 3*A1))
- Cory Magel

Game design priority: Fun > Balance > Realism (greater than > less than).
(Channeling Companion, RMQ 1 & 2, and various Guild Companion articles author).

"The only thing I know about adults is that they are obsolete children." - Dr Seuss

Offline Defendi

  • Final Redoubt
  • **
  • Posts: 1,641
  • OIC Points +0/-0
  • Final Redoubt Press
    • Final Redoubt Press
Re: Some Excel help?
« Reply #8 on: March 06, 2013, 10:47:09 PM »
Yeah, if you don't need diminishing returns, that will do it.
The Echoes of Heaven:  Available for HARP and Rolemaster.  www.FinalRedoubt.com

Offline jdale

  • RMU Dev Team
  • ****
  • Posts: 7,119
  • OIC Points +25/-25
Re: Some Excel help?
« Reply #9 on: March 07, 2013, 12:28:27 AM »
So playing with it I think I have it.. I want...
=IF(A1=0, -15, IF(A1>0, 3*A1))

You actually need one more term in the nested If statement. That specifies the value if A1 does not = 0 and is not greater than 0.

If you know A1 will never be negative, this is redundant and you could simply use:

=IF(A1=0, -15, 3*A1)

Or if you want to be exhaustive and still keep it simple:

=IF(A1<1, -15, 3*A1)

System and Line Editor for Rolemaster

Offline Cory Magel

  • Loremaster
  • ****
  • Posts: 5,629
  • OIC Points +5/-5
  • Fun > Balance > Realism
Re: Some Excel help?
« Reply #10 on: March 07, 2013, 01:14:43 AM »
I'll probably have to go to the lookup since diminishing returns will factor in and probably quicker than I hope... it was just driving me nuts not figuring out the formula.  I know just enough excel to get myself in trouble, so it's always good to learn more.
- Cory Magel

Game design priority: Fun > Balance > Realism (greater than > less than).
(Channeling Companion, RMQ 1 & 2, and various Guild Companion articles author).

"The only thing I know about adults is that they are obsolete children." - Dr Seuss

Offline Merkir

  • Senior Adept
  • **
  • Posts: 667
  • OIC Points +0/-0
  • Long lost GM
    • Information Technology
Re: Some Excel help?
« Reply #11 on: March 07, 2013, 05:31:47 AM »
merkir, I think you might have misunderstood.
If the skill is 0 then the total should result in -15.
If the skill is 1 or higher than the skill should total 3x the skill.
What you have above results in a skill level of 3 being -15 when it should be 9.

Actually I answered precisely what you originally asked, but that's just me being pedantic.  ;)

Offline Grinnen Baeritt

  • Senior Adept
  • **
  • Posts: 505
  • OIC Points +0/-0
Re: Some Excel help?
« Reply #12 on: March 07, 2013, 06:04:43 AM »
The lookup table is the simplest way. If you are producing a bonus based upon diminishing returns ;)

Though ensure that the table is big enough to accommodate the very large number of ranks.

Offline Cory Magel

  • Loremaster
  • ****
  • Posts: 5,629
  • OIC Points +5/-5
  • Fun > Balance > Realism
Re: Some Excel help?
« Reply #13 on: March 07, 2013, 11:16:54 AM »
I know Excel doesn't like it when you put too many functions in a single cell, but I'm curious if it's actually possible to put in a formula for three levels of diminishing returns in a single cell.

Say... 1-20 ranks are at x3, 20-40 at x2 and 41+ at x1?  I've tried this, but it says there are too many formulas in the cell.  I assume this is why a lookup table is the easy way to go?
- Cory Magel

Game design priority: Fun > Balance > Realism (greater than > less than).
(Channeling Companion, RMQ 1 & 2, and various Guild Companion articles author).

"The only thing I know about adults is that they are obsolete children." - Dr Seuss

Offline markc

  • Elder Loremaster
  • ****
  • Posts: 10,697
  • OIC Points +0/-0
Re: Some Excel help?
« Reply #14 on: March 07, 2013, 04:03:52 PM »
I will have to check my groups old program in Excel 97 to give you an example of how he did it (if I can find it). But I seem to remember that he had the same problem and had to do a little trick to get around the problem.
MDC
Bacon Law: A book so good all PC's need to be recreated.
Rule #0: A GM has the right to change any rule in a book to fit their game.
Role Play not Roll Play.
Use a System to tell the story do not let the system play you.

Offline Cory Magel

  • Loremaster
  • ****
  • Posts: 5,629
  • OIC Points +5/-5
  • Fun > Balance > Realism
Re: Some Excel help?
« Reply #15 on: March 07, 2013, 06:13:42 PM »
Essentially I'd like to be able to have...
0=-15
20 ranks=3*20
Ranks 21-40 add 2 each to that...
Ranks 41+ add 1 each to that...
...in their own single cells and not have to use a lookup table, but I don't know as if you can get it to treat the information four different ways. (Obviously I'm modifying the diminishing returns in RMSS).  I'm not worried about speed/performance as this will only to be build and level character skill sheets.  Looking around on the internet is like searching for a nettle in a haystack the size of, well, the internet.

I've written out a couple that look like they should work, but while they are not giving me any errors they also are not doing anything other than multiply the skill rank by three.
- Cory Magel

Game design priority: Fun > Balance > Realism (greater than > less than).
(Channeling Companion, RMQ 1 & 2, and various Guild Companion articles author).

"The only thing I know about adults is that they are obsolete children." - Dr Seuss

Offline jdale

  • RMU Dev Team
  • ****
  • Posts: 7,119
  • OIC Points +25/-25
Re: Some Excel help?
« Reply #16 on: March 07, 2013, 06:36:40 PM »
You can nest fairly deep... maybe 7 levels? Here's what you just said:

=IF(ranks<1,-15,IF(ranks<21,ranks*3,IF(ranks<41,60+(ranks-20)*2,100+(ranks-40)*1)))

A lookup table makes more sense if you have different types of progressions. No real point if everything has the same progression.
System and Line Editor for Rolemaster

Offline Defendi

  • Final Redoubt
  • **
  • Posts: 1,641
  • OIC Points +0/-0
  • Final Redoubt Press
    • Final Redoubt Press
Re: Some Excel help?
« Reply #17 on: March 07, 2013, 06:40:58 PM »
I was just comming in to write that equation.  Thanks jdale.  :)

Yeah, mine was done back in the day, when computation problems and the size of the spreadsheet were big issues.  We set it up to automatically count development points and that turned the spread sheet for a half meg to 4 megs, IIRC, and so we rolled that back.
The Echoes of Heaven:  Available for HARP and Rolemaster.  www.FinalRedoubt.com