Shortest way to have multiple Random #s in same cell

droltac

New Member
Joined
Aug 27, 2011
Messages
6
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I play D&D and I’m trying to find the shortest formula to generate multiple random #s in one cell.

so for example “rolling” 3 six sided dice.
I’ve been using =randbetween(1,6)+randbetween(1,6)+randbetween(1,6) but there must be a shorter way
i tried =3*randbetween(1,6) but this isn’t accurate because it is just generating 1 random # and then multiplying it by 3

any help would be much appreciated
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What version of Excel are you using?

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Windows 10 w/ office 365
I have added that info to my profile
 
Upvote 0
Thanks for that, how about
Excel Formula:
=TEXTJOIN(", ",,RANDARRAY(,3,1,6,1))
 
Upvote 0
Thanks for that, how about
Excel Formula:
=TEXTJOIN(", ",,RANDARRAY(,3,1,6,1))
Thanks for the quick reply. That will definitely give me the die rolls, but I unfortunately I need the total of all the rolls.

I did find this macro (but I would prefer a formula where as I have never used macros):

Sub DiceXlator()
Dim r As Range, v As String, NewForm As String, deemode As Boolean
Dim dee As String
dee = "d"
deemode = False
For Each r In Selection
v = r.Value
NewForm = "="
For i = 1 To Len(v)
ch = Mid(v, i, 1)
If ch = dee Then
NewForm = NewForm & "*RANDBETWEEN(1,"
deemode = True
Else
If Not IsNumeric(ch) And deemode Then
deemode = False
NewForm = NewForm & ")"
End If
NewForm = NewForm & ch
End If
Next i

If deemode Then
NewForm = NewForm & ")"
End If

r.Offset(0, 1).Formula = NewForm
Next r
End Sub
 
Upvote 0
In that case how about
Excel Formula:
=SUM(RANDARRAY(,3,1,6,1))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,695
Members
449,117
Latest member
Aaagu

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