In this example, we will explain how to simulate rolling two dice in Excel.
Note: This tutorial will not teach you the basics of formatting. We assume that you already know how to change font size and style, insert rows and columns, draw borders, change background color, and so on.
- Currently, each cell contains the letter “l” (lower case). In font Wingdings it looks like a dot:
- Enter a function RANDBETWEEN (RANDOMBETWEEN) to cell C2:
=RANDBETWEEN(1,6)
=СЛУЧМЕЖДУ(1;6)
- Enter the formula shown below into the yellow filled cells.
=IF(OR(C2=2,C2=3,C2=4,C2=5,C2=6),"l","")
=ЕСЛИ(ИЛИ(C2=2;C2=3;C2=4;C2=5;C2=6);"l";"")
If a 2, 3, 4, 5, or 6 is rolled, then those cells must contain a dot.
- Enter the formula shown below into the red filled cells.
=IF(OR(C2=4,C2=5,C2=6),"l","")
=ЕСЛИ(ИЛИ(C2=4;C2=5;C2=6);"l";"")
If a 4, 5, or 6 is rolled, those cells must contain a dot.
- Enter the formula shown below into the blue filled cells.
=IF(C2=6,"l","")
=ЕСЛИ(C2=6;"l";"")
If a 6 is rolled, these cells must contain a dot.
- Enter the formula below in the gray cell.
=IF(OR(C2=1,C2=3,C2=5),"l","")
=ЕСЛИ(ИЛИ(C2=1;C2=3;C2=5);"l";"")
If a 1, 3, or 5 is rolled, that cell must contain a dot.
- Copy Range C2:E5 and paste it into the range G2:I5.
- Change cell font color C2 и G2 to green (so that no numbers are visible).
- Нажмите кнопку Roll the Dice (or key F9).
Result: