Excel Game Tutorialsby James Highland
Microsoft Excel is a versatile program capable of many tasks. Data management, charts, and reports are commonly created using the program. But Excel's tool set extends to a wide variety of applications, limited only by creativity. The combination of formulas, graphics control, and integrated Visual Basic programming make the program suited to games.
It is possible to build engaging applications in Excel using nothing more than its built-in conditional formulas. In particular, the "If" statement allows for considerable interactivity when used with trivia-like questions. The program can track a user's answers and offer the percentage of accuracy in her responses. In this way, a game in this design could even be used as a fun productivity tool to measure an employee's knowledge on a certain subject. The concept is simple. The Excel spreadsheet contains a series of questions. On a separate sheet, or in a separate column, the answers to these questions are listed. To prevent the user from seeing the answers, the cells containing their text can be hidden by using the security features of the program. The Protection area of each Format Cells dialog box for the answer cells can be set in combination with the overall sheet security settings provided in the Tools menu. Each question contains three cells: the question itself, a cell for the user's answer, and an adjacent formula cell to compare her response to the correct answer. The comparison cell contains a simple "If" formula to determine if the response cell is identical to the answer cell noted elsewhere in the document. The outcome of the "If" statement can either be "Correct!" or "Wrong!" or whatever the creator wishes. A series of trivia questions or other humorous applications can be implemented in this strategy to create a fun text-based game.
More aggressive gaming applications can be built in Excel using the Visual Basic programming language. This extends Excel's functionality in many exciting directions. The contents and colors displayed in cells can change on-the-fly, based on user keystrokes or text input. Games resembling the popular Minesweeper program are possible, as well as mazes (See References 1 and 2). The best way to understand the structure of this style of gaming is to view the Visual Basic code of games already written. GameDev.net and Pearson Software Consulting both offer free Excel downloads with open source code for their games.
- photo_camera Jupiterimages/Pixland/Getty Images