Disclosure: This post may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.

How to Make Games in Excel (with Easy Steps)

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.


Download Workbook


6 Easy Steps to Make Poker Machine Game in Excel

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).

Forming Basic Outlines to Make Games in Excel

  • 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.

Read More: How to Fix Formula in Excel (9 Easy Methods)


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.

Inserting Formulas to Make Games in Excel

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, so you will get the message “SORRY!!! You COULDN’T Make it!!

Inserting Formulas to Make Games in Excel


Similar Readings


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).

Recording Macros to Make Games in Excel

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.

Recording Macros to Make Games in Excel

  • 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.

Recording Macros to Make Games in Excel

Read More: How to Create Toggle Button on Excel VBA UserForm


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

Conditional Formatting of Cell with Result to make Games in Excel

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.

Conditional Formatting of Cell with Result to make Games in Excel

  • Later go to the Fill tab, choose the Background color as Red, and press OK.

Afterward, you will have the following preview.

  • Press OK.

preview

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.

Conditional Formatting of Cell with Result to make Games in Excel

Later, the Format Cells dialog box will appear.

  • Under the Font tab, choose the Font style as Bold, and the color 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.

Conditional Formatting of Cell with Result to make Games in Excel

Read More: How to Color Code Cells in Excel (3 Efficient Methods)


Similar Readings


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.

Formatting Cells with Input Values to make games in Excel

  • 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.

Formatting Cells with Input Values to make games in Excel

Afterward, you will have the following preview.

  • Press OK.

Similarly, assign different colors for other values.

Formatting Cells with Input Values to make games in Excel

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.

font style

  • Change the Font size to 16.

font size

The final look of our game will be like the following figure.

Formatting Cells with Input Values to make games in Excel

Read More: How to Make Flashcards in Excel (2 Suitable Ways)


Step-6: Now Play Your Game!

You can now play this game by clicking on the SPIN button until the number matches.

play your created games in Excel

  • 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.

Practice


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

Tanjima Hossain

Tanjima Hossain

Hello everyone, This is Tanjima Hossain. I have completed my graduation from BUET. Then I have started working as a technical writer in SOFTEKO. I have grown interest in technical content writing, research topics, numerical analysis related field and so I am here. Besides this I love to interact with different people and I love to spend my spare time by reading, gardening ,cooking etc.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo