Completing and checking a Magic Square This guide has two main purposes: - to introduce magic squares and encourage you to investigate them; - - to introduce some important techniques for constructing and entering spreadsheet formulae. Index Double-click an entry to go directly to that step. Begin with step 1! 1) Setting-up 2) Magic Squares 3) A diagonal total 4) A column total 5) Auto totalling 6) Auto solo 7) A row total 8) Copying cells 9) The other diagonal 10) Copying cells again 11) New squares for old? 12) Solve these! 1. Magic Squares A square of numbers in which the columns, rows and diagonals have the same total is called a magic square. The shared total is called the square's magic number. Copy the magic square begun here into the block of bordered cells, and then complete the square. Begin by finding the square’s magic number from the completed diagonal which runs up from cell D5 to F3. 4 7 6 3 A diagonal total You will have found that placing numbers in a magic square involves lots of mental arithmetic - easy, but far too much of it for comfort! Why not make the spreadsheet do the work? Here's how ... Cells display numbers or words. However, they can contain numbers, words, or formulae. A formula is simply a rule for calculating what number (or words) should be displayed. Enter a formula to total the numbers in the diagonal from D3 to F5 as follows: - click into cell G6 - beginning with the equals sign, enter the formula: = D3 + E4 + F5 - complete the entry by tapping <Enter> ... the formula is at once evaluated (worked out) and the result displayed 4 A column total Now click into cell D6 and enter a formula to total the numbers in the column from D3 to D5. You will need to use what you learned in step 3 - remember to begin with an equals sign. 5 Auto totalling 5 Provided a block of cells is already filled with numbers, you can ask Excel to write a totalling formula for you! Try this on the column from E3 to E5, as follows: - click into cell E6 - click the AutoSum button <Enter> - look at the formula line (just above the letters at the top of each column) and you will see the formula: - and then tap = SUM(E3:E5) ... this simply means: Find the SUM of the block of cells which begins at E3 and ends at E5 6 Auto solo Now get Excel to enter in cell F6 a formula to total the last column. (Refer to the previous step if you need a reminder on the method!) 7 A row total In step 5 you learned that Excel can be made to write a SUM formula for any block of cells containing numbers - the AutoSum button works for rows exactly as it does for columns. Get Excel to enter in cell G3 a formula to total the first row of the magic square 8 Copying cells You could use the method of step 7 to enter formulae for the two remaining row totals in cells G4 and G5. However, Excel can be made to use the one formula you have entered as a pattern for creating the rest automatically. Here's how: - click into cell G3 - move the pointer to the bottom-right corner of cell G3, so that the pointer looks like cross-hairs ... ... and then drag the corner of the cell down the column to cell G5 - have a look at the formulae written by Excel by clicking into cell G5 … …on the formula line you will see the formula: = SUM(D5:F5) ... Excel has adjusted the copied formula so that it does the same job relative to its surroundings (that is, so that it adds up the three cells to its left) - 9 if you click into cell G4 you will see that the formula there has been adjusted in the same way The other diagonal It remains to enter in cell G2 a formula to total the other diagonal (cells D5 to F3). The AutoSum button works only for a block of cells in one row or one column: for this job you will need to use the method of step 3 - get there via the Index if you would like a reminder. 10 Copying cells again There are other arrangements of the numbers you have placed in the magic square which also provide a solution. And there are other sets of numbers which can provide solutions. To explore these it will be useful to have a second square, complete with all the totalling formulae. You could start from scratch but copying can save you the trouble! Here's how: - select your magic square "kit" by dragging from cell D2 to cell G6 - click the Copy button - click into cell D10 and click the Paste button - try changing any number in the second square ... the affected totals change correctly - see how Excel copied the formulae by clicking into cell G11: the formula bar displays: = SUM(D11:F11) ... the formula copied from cell G3 has been adjusted so that it does the same job relative to its surroundings - look at the formulae in F14 and G14 to check that the same thing has happened to formulae for column and diagonal totals 11 New squares for old? Using your second magic square kit, see what other successful arrangements you can find of the numbers placed in the first square. Are some of them really different, or are they just different ways of looking at your first square? (One other way of looking at your first square would be to stand on your head - or to turn the "paper" upside down). 12 Solve these! Using your second magic square kit (or further copies of the kit created by copying and pasting as before), see if you can complete these magic squares: (a) (b) 8 3 11 6 12 4 15 (c) 13 (d) 10 6 5 13 6 7 13 8 14 9 15 That’s it! Congratulations! You have completed this guide.