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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,223,162
Messages
6,170,431
Members
452,326
Latest member
johnshaji

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