This tutorial covers how to create a die roller in Excel that graphically displays a pair of dice on your Worksheet. The dice can be re-rolled repeatedly by recalculating the worksheet.
The dice will display a random number generated by the RANDBETWEEN function. The dots on the die faces are created using the Wingdings font, and a combination of the AND, IF, and OR functions control when dots appear in each cell. Depending on the random numbers generated by the RANDBETWEEN functions, dots will appear in the appropriate cells in the worksheet.
Building The Die In Excel
The steps below cover the formatting techniques used to graphically display the dice on an Excel worksheet; they include changing cell size and cell alignment, as well as font type and size:
- Select cells D1 to J3.
- Select the Format button in the Home tab.
- Set the Row Height to 24.75 and the Column Width to 5.
- Set the Horizontal Cell Alignment to centre and the Vertical Cell
Alignment to the middle. - Set the Font Type to Wingdings and the Font Size to 36.
- Select cells D1 to F3.
- Set the Cell Background Colour to blue.
- Select cells H1 to J3.
- Set the Cell Background Colour to red.
Add The RANDBETWEEN Function For The Die In Excel
The RANDBETWEEN function is used to generate the random numbers shown on
the dice. Follow these steps to implement the random number generator:
For the First Die
- Click on cell E5.
- Click on the Formulas tab of the ribbon menu.
- Choose Math & Trig from the ribbon.
- Click on RANDBETWEEN in the list to bring up the Formula Builder.
- Click on the bottom line.
- Type the number 1 on this line.
- Click on the top line.
- Type the number 6 on this line.
- Click Done.
- A random number between 1 and 6 should appear in cell E5.
For the Second Die - Click on cell I5.
- Repeat steps 2 to 9 above.
A random number between 1 and 6 should appear in cell I5.
The Functions Behind The Dots #1
In cells D1 and F3, type the following function:
=IF(AND(E5 >=2, E5<=6),”l”,” “)
This function tests to see if the random number in cell E5 is between 2 and 6; if so, the function places a lowercase L in cells D1 and F3. If not, it leaves the cells blank.
To get the same result for the second die, type the following function
into cells H1and J3 :
=IF(AND(I5>=2, I5<=6),”l”,” “)
The letter l (lowercase L) is a dot in the Wingdings font.
The Functions Behind The Dots #2
In cells D2 and F2, type the following function:
=IF(E5=6, “l”, ” “)
This function tests to see if the random number in cell E5 is equal to 6; if so, it places a dot in cells D2 and F2. If not, it leaves the cell blank. To get the same result for the second die, type the following function H2 and J2:
=IF(I5=6,”l”, ” “)
The Functions Behind The Dots #3
In cells D3 and F1, type the following function:
=IF(AND(E5>=4, E5<=6),”l” , ” “)
This function tests to see if the random number in cell E5 is between 4 and 6; if so, it places a dot in cells D3 and F1. If not, it leaves the cells blank. To get the same result for the second die, type the following function into cells H3 and J1:
=IF(AND(I5>=4, I5<=6),”l”, ” “)
Rolling The Dice
To roll the dice all you do is press F9 or Fn F9 at the same time.
Go to https://www.computergaga.com/blog/simulate-a-dice-throw-in-excel/ for more information.
Thanks for the article post.Really thank you! Great.
Thanks a lot for the article post.Much thanks again. Fantastic.2010 price in viagra
buy sildenafil
hydroxychloroquine 10 price
sildenafil 100mg tablets buy online
dapoxetine buy online
where can you buy sildenafil
cialis 2
benicar 40 coupon
strattera prices 100 mg
viagra pfizer price
canada generic viagra price
best price for cymbalta
buy viagra with discover card
suhagra 100mg tablet price
buy generic valtrex without prescription
viagra pills discount
buy viagra australia paypal
order generic paxil online
buy dapoxetine singapore
finasteride cream
order acyclovir pills
hydroxychloroquine covid-19
viagra 4 tablets
plaquenil brand
suhagra tablet 50 mg
where can you buy cialis online
bactrim forte
bladder cancer erectile beefs function
erectile male dysfunction
erectile pain
for erectile health and better blood flow
erectile recovery after prostatectomy
erectile function paralysis
erectile malfunction
erectile enhancement supplements
erectile dysfunction reviews