Table-top game mechanic / getting a result from a table

briarlynn_daisy

New Member
Joined
Jun 5, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi, I am trying to use Excel to simulate die rolls and generating stats and modifiers.

I have a table of stat roll outcomes, and the associated percentile modifier:
Book1
GH
2Stat RollsModifier
3-5-0.15
4-4-0.15
5-3-0.1
6-2-0.1
7-1-0.05
80-0.05
910
1020
1130.05
1240.05
1350.1
1460.1
1570.15
1680.15
1790.2
18100.2
19110.25
20120.25
21130.3
22140.3
23150.35
24160.35
Sheet1


And on my other table for a random stat roll and modifiers, I want a to use the randbetween fx to generate a roll, and then display the associated modifier based on the the result of that roll. How can I do this?
Book1
JKL
2Stat:Value (-5 through 16)Modifier
3Luck
4Intellect
5Resilience
6Agility
7Strength
8Magik
9Awareness
10Personality
11Spirit
Sheet1
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the MrExcel forum!

You can just use a lookup:

Book1
GHIJKL
1
2Stat RollsModifierStat:Value (-5 through 16)Modifier
3-5-0.15Luck90.2
4-4-0.15Intellect 70.15
5-3-0.1Resilience-3-0.1
6-2-0.1Agility-4-0.15
7-1-0.05Strength -3-0.1
80-0.05Magik10
910Awareness110.25
1020Personality140.3
1130.05Spirit160.35
1240.05
1350.1
1460.1
1570.15
1680.15
1790.2
18100.2
19110.25
20120.25
21130.3
22140.3
23150.35
24160.35
25
Sheet3
Cell Formulas
RangeFormula
K3:K11K3=RANDARRAY(9,,-5,16,TRUE)
L3:L11L3=VLOOKUP(K3#,G3:H24,2,0)
Dynamic array formulas.


Since the modifiers follow a simple pattern, you can also use

Excel Formula:
=INT((K3#-1)/2)*0.05

for the L3 formula, and you don't need to reference the G2 table at all.
 
Upvote 1
Solution
Welcome to the MrExcel forum!

You can just use a lookup:

Book1
GHIJKL
1
2Stat RollsModifierStat:Value (-5 through 16)Modifier
3-5-0.15Luck90.2
4-4-0.15Intellect 70.15
5-3-0.1Resilience-3-0.1
6-2-0.1Agility-4-0.15
7-1-0.05Strength -3-0.1
80-0.05Magik10
910Awareness110.25
1020Personality140.3
1130.05Spirit160.35
1240.05
1350.1
1460.1
1570.15
1680.15
1790.2
18100.2
19110.25
20120.25
21130.3
22140.3
23150.35
24160.35
25
Sheet3
Cell Formulas
RangeFormula
K3:K11K3=RANDARRAY(9,,-5,16,TRUE)
L3:L11L3=VLOOKUP(K3#,G3:H24,2,0)
Dynamic array formulas.


Since the modifiers follow a simple pattern, you can also use

Excel Formula:
=INT((K3#-1)/2)*0.05

for the L3 formula, and you don't need to reference the G2 table at all.
Thank you soo much!
 
Upvote 0
Welcome to the MrExcel forum!

You can just use a lookup:

Book1
GHIJKL
1
2Stat RollsModifierStat:Value (-5 through 16)Modifier
3-5-0.15Luck90.2
4-4-0.15Intellect 70.15
5-3-0.1Resilience-3-0.1
6-2-0.1Agility-4-0.15
7-1-0.05Strength -3-0.1
80-0.05Magik10
910Awareness110.25
1020Personality140.3
1130.05Spirit160.35
1240.05
1350.1
1460.1
1570.15
1680.15
1790.2
18100.2
19110.25
20120.25
21130.3
22140.3
23150.35
24160.35
25
Sheet3
Cell Formulas
RangeFormula
K3:K11K3=RANDARRAY(9,,-5,16,TRUE)
L3:L11L3=VLOOKUP(K3#,G3:H24,2,0)
Dynamic array formulas.


Since the modifiers follow a simple pattern, you can also use

Excel Formula:
=INT((K3#-1)/2)*0.05

for the L3 formula, and you don't need to reference the G2 table at all.
I'm getting a Spill error when I use =RANDARRAY(9,,-5,16, TRUE).
Book1
IJK
2Stat:Value (-5 through 16)Modifier
3Luck#SPILL!20%
4Intellect #SPILL!-5%
5Resilience#SPILL!5%
6Agility#SPILL!-5%
7Strength #SPILL!15%
8Magik#SPILL!15%
9Awareness#SPILL!10%
10Personality#SPILL!0%
11Spirit#SPILL!5%
Sheet1
Cell Formulas
RangeFormula
J3:J11J3=RANDARRAY(9,,-5,16,TRUE)
 
Upvote 0
GOT IT!

PoD Roll Mechanics.xlsx
FGHIJKLMNOPQRST
1Stat RollsModifierSTAT AVGBONUSStat:Value (-5 through 16)Modifier
2-5-15%-51Luck1225%
3-4-15%-41Intellect -1-5%
4-3-10%-31Resilience1635%
5-2-10%-21Agility1125%
6-1-5%-12Strength -1-5%
70-5%02Magik-1-5%
810%12Awareness35%
920%22Personality10%
1035%33Spirit-4-15%
1145%43Stat AVG4
12510%53STAT BONUS3.0
13610%63
14715%74
15815%84LuckINTRESAGILSTRMAGAWAREPERSSPR
16920%9425%-5%35%25%-5%-5%5%0%-15%
171020%104
181125%1152.5%19.5%3.5%-27.5%-0.5%49.5%40.5%-10.0%68.5%
191225%125
201330%135
211430%145WILL%TILECNTR RNGSAVES%TILE
221535%156MAG WILL13%25%FORTITUDE55%
231635%166DIV WILL3%5%PSYCH0%
24MYST WILL23%45%ANIMUS45%
25DEATH30%
Sheet1
Cell Formulas
RangeFormula
N2:N10N2=VLOOKUP(M2#,$F$2:$G$23,2,0)
M2:M10M2=RANDARRAY(,1,-5,16,TRUE)
M11M11=AVERAGE([Value (-5 through 16)])
M12M12=LOOKUP(Table4[[#Totals],[Value (-5 through 16)]],I2:J23)
L16L16=N2
M16M16=N3
N16N16=N4
O16O16=N5
P16P16=N6
Q16Q16=N7
R16R16=N8
S16S16=N9
T16T16=N10
L18L18=($B2+L$16)/10
M18M18=($B3+M$16)/10
N18N18=($B4+N$16)/10
O18O18=($B5+O$16)/10
P18P18=($B6+P$16)/10
Q18Q18=($B7+Q$16)/10
R18R18=($B8+R$16)/10
S18S18=($B9+S$16)/10
T18T18=($B10+T$16)/10
M22M22=N7+N4/2
N22:N24N22=[@[%TILE]]*2
M23M23=N10+N4/2
M24M24=N8+N4/2
Q22Q22=(($N$2+$N$4+$N$6)/3)*M12
Q23Q23=(($N$2+$N$3+$N$4)/3)*M13
Q24Q24=(($N$2+$N$4+$N$10)/3)*M12
Q25Q25=(($N$2+$N$4+$N$6+$N$10)/4)*M12
 
Upvote 0
It looks like you're new to the world of spill formulas. Just for future reference, a spill formula is a formula you put in a single cell, but the formula generates multiple results, which then "spill" to other cells. So for example, my original RANDARRAY formula was designed to put in a single cell, then it would create 9 random numbers which would fill the cells below that cell. But it requires that the cells below it are empty. So when you got the SPILL errors, it looks like you were trying to put the formula in all of the cells. There's nothing wrong with the way you ended up doing it, it's just a different approach.

Anyway, I'm glad you got it working!
 
Upvote 1

Forum statistics

Threads
1,221,849
Messages
6,162,425
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top