title: Dynamic Dice Roller Spreadsheet using ArrayFormula
body: <p>I am making a dice roller tool where the user can adjust both the number of sides on the die and the number of dice rolled.</p>
  
  <p>To do this I have the user indicate the number of sides on the dice in cell B2, and the number of dice to roll in B3.</p>
  
  <p>Then I use </p>
  
  <pre><code>=IF(ISNUMBER(E2),SEQUENCE(B3,1,1,1),"-")
  </code></pre>
  
  <p>to create a series of numbers in the E column equal to the number of dice being rolled. Next to this column I use</p>
  
  <pre><code>=IF(ISNUMBER(D2:D),RANDBETWEEN(1,$B$2),"x")
  </code></pre>
  
  <p>in series to get a selection of random numbers.</p>
  
  <p>This works fine. However, I want to know if someone can show me how they might accomplish the same using an ArrayFormula.</p>
  
  <p>When I try to apply ARRAYFORMULA to the formula I simply get a column of identical numbers.</p>
  
  <p>My task seems like it could be solved using some combination of RANDBETWEEN and RANDARRAY, but I am having trouble figuring out how to do it.</p>
  
  <p>Edit:
  Here is a link to the current spreadsheet
  <a href="https://docs.google.com/spreadsheets/d/1-W37KSwDrKjNPvyCP2f56WMUEzXNnYZ2Ob77Ed0PHQ4/edit?usp=sharing" rel="nofollow noreferrer">Dice Roller</a></p>