Daily tips for using Microsoft Excel.

Thursday, December 29, 2005

Magic Squares in Excel, Part II

Back in 2004, I documented a method for creating magic squares in Excel. This method was passed along to me by my friend and former co-worker Dave Strong. Dave's method worked great for numbers like 34, 38, 42, etc. However, if you used Dave's method to produce a magic square for 35, you would have decimals in each square.

Recently, MrExcel reader Ray Battersby found that web page and figured there had to be a better way. Ray sent in a modification to Dave's method - he found the four secret cells to which you could add a 1 to change the magic square for 34 into the magic square for 35. This method will work for any integer above 30.

Scroll down on http://www.mrexcel.com/tip069.shtml to review Ray's method.

Thanks to Ray for this information!