0% found this document useful (0 votes)
1K views4 pages

Escape The Sheet (Excel Puzzle) : Step 1: The Game Concept

This document describes an Excel-based puzzle game called "Escape the Sheet" that the author created for colleagues. [1] It consists of two parts - a trivia quiz with randomly selected multiple choice questions, and a logic puzzle involving remembering a random sequence of colored cells. [2] The game utilizes Excel functions like VLOOKUP, RANDBETWEEN, and conditional formatting, as well as VBA macros to automate gameplay and scoring. [3] Players must correctly answer the trivia questions and deduce the number sequence associated with random cell colors in order to "escape the sheet" and complete the game.

Uploaded by

Amit Deswal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views4 pages

Escape The Sheet (Excel Puzzle) : Step 1: The Game Concept

This document describes an Excel-based puzzle game called "Escape the Sheet" that the author created for colleagues. [1] It consists of two parts - a trivia quiz with randomly selected multiple choice questions, and a logic puzzle involving remembering a random sequence of colored cells. [2] The game utilizes Excel functions like VLOOKUP, RANDBETWEEN, and conditional formatting, as well as VBA macros to automate gameplay and scoring. [3] Players must correctly answer the trivia questions and deduce the number sequence associated with random cell colors in order to "escape the sheet" and complete the game.

Uploaded by

Amit Deswal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

instructables

Escape the Sheet (Excel Puzzle)

by Left-field Designs

Escape the sheet is a little Excel game I put together several years ago to teach a group of colleagues some more
advanced Excel skills while having a little fun with Trivia and Logic puzzles, two things I love!

This game is a combination of excel formulas, conditional formatting for both the current cell and for values based
on another cell and some VBA macros to make it a little more challenging to code up.

Step 1: The Game Concept

You don't really need any huge programming to the player, the player may request a new set of
experience or expensive software to write a game, questions.
here's one you can do in excel.
Once the 5 questions have been answered, the system
The game is a small 2 parter, the rst level is a trivia will then inform the player that they have not been
quiz. successful and to try again or it opens up room 2.

There is a bank of 50 questions in the system though Room 2 is a logic puzzle where a colour sequence this
this could be more if you're so inclined. is also randomly generated and the player can
regenerate at any time. Each of the colours is
To remove any possible ambiguity with spelling or associated with a number 1-10, the player must use
case matching all of the questions have numeric trial and error/memory to nd the numbers that
answers. correspond and replicate the sequence.

The system will randomly present 5 of these questions

Escape the Sheet (Excel Puzzle): Page 1


Step 2: The Setup

Initially I set up the workbook with 4 blank column that takes this a step further and removes
worksheets. duplicates using both the RANK.EQ and COUNTIF
functions, these rank the value against the rest of the
Starting with sheet 3 I created a table with a header list and count if there is a repeat of the value in the
"Question" & "Answer" full list, these values are added together and this
produces a random and unique value. We can con rm
In column A and using auto ll numbers 1-50 are this by copying the list, then paste values and sort
entered, it's important that the questions are smallest to largest, this will show all unique values 1-
numbered for the selection process. 50.

I then go online and through my memory for 50 Back on Room 1, we can then use VLOOKUP to take
questions with numerical answers. the 1st, 2nd, 3rd etc. value from the list and look it up
on the question sheet for both the question and the
We now need a way to import these questions to the answer. Each time the random numbers are
Room 1 screen on sheet 1. regenerated, a new set of questions will appear on the
Room 1 screen.
This is done using a VLOOKUP function, this allows us
to use the number at the beginning of the question Excel is con gured to auto calculate, this causes a
row. However, if we just used 1-5 from the Room 1 problem with the RANDBETWEEN function because
sheet we would only ever get the rst 5 questions and every time a page is loaded, the calculation runs and
in the same order. This is where sheet 2 comes in, reorders the questions. This can be set to manual buy
there are 2 rows of formulae here, the rst uses the going to Formulas in the Ribbon, then Calculation
RANDBETWEEN function, this allows the user to enter options and setting to manual, we will take care of
a range between which a random entry will be calculation later.
generated. The problem is that with a small range
such as this there is a high probability that there will Before we are done with this page we hide Column C
be duplicates and that would not make for a very (the actual answers)
tricky quiz. So to overcome this there is a second

Escape the Sheet (Excel Puzzle): Page 2


Step 3: Answer Checks

The answer checking is really quite simple, The value new macro. In this case I called it check answers
of all the expected answers is summed into a cell at
the bottom of Column C in Room 1, the players All this does is runs the calculation (for this sheet only)
answers are loaded into Column D and summed. and checks if the sum of the expected answers match
the sum of the players answers. If the numbers don't
A VBA script is programmed into a button to run the match then a message box pops up to say try again, if
calculation and check the answers. they are successful then we unhide the sheet for
Room 2.
To add the button go to Developer in the Ribbon, add
a button using Insert -> Button There is also a conditional format placed in Cell B28
with an arrow, prompting the user to move tabs.
Once you draw the button there is an option to add a

Step 4: Getting Different Questions

To get new questions for the Player we simply need to rerun the calculations on both sheet 2 (the random number
sheet) and then on the Room 1 sheet, this causes the VLOOKUP to reference a new set of numbers and also to pull
in the new associated questions. This piece of code also clears the Players answer section.

Escape the Sheet (Excel Puzzle): Page 3


Step 5: Room 2

Room 2 is a logic and memory puzzle, the user us Player answers are also summed and the macro runs
presented with a sequence of 6 randomly generated the calc, lls in the colours and tests the result. This
colours, again this uses the RANDBETWEEN function either prompts the player to try again or
with the range of 1-10. congratulates them on the win.

There are conditional formatting rules that based on There is also a new sequence button to allow the
the number in the cell that the ll and font colour player get new colours, this runs the calc but only on
change depending on the value. the cells in Row 10 and clears Player answers in Row
12.
The player must enter these numbers in sequence
and then enter check, there is no clues to what colour I have tried to upload the game but as it is a .xlsm le
is what number so as they test they must remember this isn't allowed so feel free to download a copy from
what result they got for each entry. here, if you have any questions drop me a message.

Again the values in the answer cells are summed, the

Nice! Never thought to use spreadsheets this way :)

Yes spreadsheets and Excel in particular are pretty amazing, they are one of the most powerful
programs on most PC's and as they can run macros you can develop a massive number of games,
I have seen classic arcade games done too. It's a rabbit hole you may not want to go down :-)

Escape the Sheet (Excel Puzzle): Page 4

You might also like