vendredi 20 mars 2020

Dynamic Dice Roller Spreadsheet using ArrayFormula

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.

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.

Then I use

=IF(ISNUMBER(E2),SEQUENCE(B3,1,1,1),"-")

to create a series of numbers in the E column equal to the number of dice being rolled. Next to this column I use

=IF(ISNUMBER(D2:D),RANDBETWEEN(1,$B$2),"x")

in series to get a selection of random numbers.

This works fine. However, I want to know if someone can show me how they might accomplish the same using an ArrayFormula.

When I try to apply ARRAYFORMULA to the formula I simply get a column of identical numbers.

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.




Aucun commentaire:

Enregistrer un commentaire