Specific Dice Roll Function

gorillatamer

New Member
Joined
Dec 11, 2012
Messages
3
Hello everyone!I am trying to come up with a function to facilitate a specific random number generation.

I want to generate N dice rolls and get the sum of those rolls. N is dependent on the number in another randomly generated cell.I am using the =RANDBETWEEN(1,6) to get a six-sided die roll.

If I use the formula =RANDBETWEEN(1,6)+RANDBETWEEN(1,6)+... I get the desired result. My issue is figuring out how to get the correct number of dice rolls without having to manually input the RANDBETWEEN(1,6).

To clarify a bit, in A1 I have =RANDBETWEEN(1,5). This determines the number of dice being rolled, I'll call this N. I need the function in B1 to give the sum of N. I can't just use =A1*RANDBETWEEN(1,6) because that gives a multiple of just one roll.

I hope I have explained this enough, but I will be glad to explain further. Thanks for all of the help in advance!

-GT
 
Last edited:

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thanks, I'll try this formula! But for knowledge sake could you explain to me how this works? I'd like to be able to play with it in the future so i want to know what I'm messing with.
 
Upvote 0
Thanks, I'll try this formula! But for knowledge sake could you explain to me how this works? I'd like to be able to play with it in the future so i want to know what I'm messing with.
I deleted that formula because it was wrong, but the following is probably a better way for you to do it because you will be able to see the numbers of the dice being added. Put the following formulas in the indicated cells...

A1: =RANDBETWEEN(1,5)

A2: =SUM(B1:F1)

B1: =RANDBETWEEN(1,6)

C1: =IF(A1>1,RANDBETWEEN(1,6),"-")

D1: =IF(A1>2,RANDBETWEEN(1,6),"-")

E1: =IF(A1>3,RANDBETWEEN(1,6),"-")

F1: =IF(A1>4,RANDBETWEEN(1,6),"-")

Note: A1 is the number of dice being rolled, A2 is the sum of the dice, B1:F1 are the dice (either a number or a dash will be displayed). To make things look nicer, I would suggest you center align (horizontally) B1:F1.
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,617
Members
449,039
Latest member
Mbone Mathonsi

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