If you are wondering about the procedures to make games in Excel, then you can go through this article to know some basic processes of creating a simple game. Excel may be famous for only data analysis purposes, but you can utilize it also for playing games.
So, let’s start with the main article to know more about the procedures.
How to Make Excel Games: 6 Easy Steps to Make Poker Machine
In the following steps, we will be showing you the ways to create a Poker Machine Game in Excel easily. The free template will also be given here if you want to play directly.
For creating this article, we have used Microsoft Excel 365 version. However, you can use another version according to your necessary.
Step-1: Forming Basic Outlines
Firstly, we will form a basic outline for entering our formulas, input values, or output values
- Give a proper title for your game’s name (here, it is POKER MACHINE GAME).
- Create a table with borders to place 3 random numbers.
- Designate space for the output result by merging three cells, and enabling the bottom border.
Step-2: Inserting Formulas
In this step, we will use the RANDBETWEEN function for generating random numbers, and the IF, AND functions to get output results depending on the random numbers.
- Write down the following function in cell B5.
=RANDBETWEEN(1,4)
Here, 1 is the start number, and 4 is the end number. Then, this function will return any value between these numbers.
- Drag the Fill Handle tool to the right.
Finally, you will get any 3 randomly generated numbers.
- To have the result, you can use the following formula.
=IF(AND(B5=C5, B5=D5), "CONGRATS for WINNING!!!", "SORRY!!! You COULDN'T Make it!!")
Formula Breakdown
AND(B5=C5, B5=D5) → AND will ensure that the two conditions are satisfied within this function, for fulfilling the conditions it will return TRUE, otherwise FALSE.
“CONGRATS for WINNING!!!” → It is the message for the logical argument TRUE.
“SORRY!!! You COULDN’T Make it!!” → This message will be given when the argument is FALSE.
As the numbers are not matched with each other here, you will get the message “SORRY!!! You COULDN’T Make it!!”
Step-3: Recording Macros
Here, we will record a macro of changing the input numbers and then assign this macro to a button.
- Go to the Developer tab >> Insert group >> Button (Form Control).
Then, a plus (+) symbol will appear.
- Drag this symbol to the right and down.
Later, the Assign Macro wizard will open up.
- Name the macro as SPIN, and click on Record.
Then, you will be taken to the Record Macro wizard.
- Press OK
- Here, you can see the Stop Recording option, which means our next action will be recorded as a macro.
- Now, press F9 to change the random numbers.
- Click on the Stop Recording button under the Developer tab now.
In this way, we have assigned our recorded macro to the button.
- Change the name of the button to SPIN.
Read More: How to Use Form Controls in Excel
Step-4: Conditional Formatting of Cell with Result
Here, we will change the color of the output cell depending on the cell value to represent easily if I won or not.
- Select the range, and then go to the Home tab >> Conditional Formatting group >> New Rule.
In this way, you will get the New Formatting Rule wizard.
- Click on the option Format only cells that contain.
- Now, put the Cell Value equal to SORRY!!! You COULDN’T Make it!!.
- Click on Format.
Later, the Format Cells dialog box will appear.
- Under the Font tab, choose the Font style as Bold, and the color White.
- Later go to the Fill tab, choose the Background Color as Red, and press OK.
Afterward, you will have the following preview.
- Press OK.
Again, do the same process for the other message.
- In the New Formatting Rule wizard, click on the option Format only cells that contain.
- Then, put the Cell Value equal to CONGRATS for WINNING!!!, and click on Format.
Later, the Format Cells dialog box will appear.
- Under the Font tab, choose the Font style as Bold, and the Color as White.
- Next, go to the Fill tab, choose the Background color as Green, and press OK.
After that, you will have the following preview.
- Press OK.
Step-5: Formatting Cells with Input Values
Now, we will change the colors of the cells with input values according to their values.
- Select the range.
- Go to the Home tab >> Conditional Formatting group >> New Rule.
- In the New Formatting Rule wizard, click on the option Format only cells that contain.
- Then, put the Cell Value equal to 1, and click on Format.
Later, the Format Cells dialog box will appear.
- Under the Fill tab, choose the appropriate color ( here, we selected Blue, Accent 1, Lighter 60%) and press OK.
Afterward, you will have the following preview.
- Press OK.
Similarly, assign different colors for other values.
In this way, according to the conditions the following colors will appear for their respective values.
To show the numbers as some symbols, which can make this game more attractive we will change the font.
- After selecting the values, we selected the font Wingdings 2.
- Change the Font size to 16.
The final look of our game will be like the following figure.
Step-6: Now Play Your Game!
You can now play this game by clicking on the SPIN button until the number matches.
- Here, you can notice the change in the numbers after just pressing once this button.
- After pressing a few times, here we matched the numbers and won the game.
Practice Section
You can practice by yourself, as we have provided a Practice section on the right side of each sheet so that you can make games in Excel.
Download Workbook
Conclusion
In this article, we have discussed various ways to make games in Excel. Hope these examples will help you a lot. If you have any further queries, then leave a comment below.
Related Articles
- How to Remove a Form Control in Excel
- How to Create Chart Slider in Excel
- Key Differences in Excel: Form Control Vs. ActiveX Control
<< Go Back to Form Control in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!