Spreadsheet - Magic Squares
Task
Create a spreadsheet that checks is an array of 9 numbers is a magic square.
Description
A magic square is a 3x3 grid of numbers in which each row, each column and each major diagonal adds up to the same total. Here is an example:
| 2 | 7 | 6 |
| 9 | 5 | 1 |
| 4 | 3 | 8 |
You can quickly verify that:
- The three rows each add up to 15 (2 + 7 + 6 = 15; 9 + 5 + 1 = 15; 4 + 3 + 8 = 15).
- The three columns each add up to 15 (2 + 9 + 4 = 15; 7 + 5 + 3 = 15; 6 + 1 + 8 = 15).
- The two diagonals each add up to 15 (2 + 5 + 8 = 15; 4 + 5 + 6 = 15).
Therefore this is a magic square.
Instructions
(a) Create a new Excel spreadsheet and save it as "Magic Squares.xls".
(b) Create a region on the spreadsheet that allows you to type in a magic square.
(c) Create a number of checks to see if it is a magic square.
(d) Use your sheet to work out which of these are magic squares and which are not.
|
|
|
|
||||||||||||||||||||||||||||||||||||
|
|
|
|
Hints
You might like to work out what the square's magic number is supposed to be first, by adding all the numbers together and dividing by three.
page revision: 6, last edited: 30 Aug 2010 23:42






