Site Meter Microsoft Office » Blog Archive » Build your own Suduko with Excel

Build your own Suduko with Excel

by Brick ONeil

If you love suduko, check out this Microsoft Excel blog, courtesy of Joseph Chirilov

Today’s author, Charlie Ellis, a Program Manager on the Excel team, shares a spreadsheet he built in Excel for solving Sudoku puzzles. The spreadsheet can be found in the attachments at the bottom of this post.

For those of you who don’t already know, Sudoku is a type of logic puzzle (that I was completely addicted to about three years ago) that requires you to place the numbers 1-9 into a grid obeying certain rules (lots more information on Sudoku is available on the web).

A while back, a fellow PM on the Excel team, Dan Cory, wrote a spreadsheet for solving Sudoku puzzles using Excel formulas and made it available on Office Online (here). Dan’s spreadsheet was great in that, unlike many of the Sudoku solving spreadsheets out there, it didn’t use any VBA or other scripting to do the work of solving the puzzles, and relied instead on the iterative calculation feature of Excel. It’s quite cool and has been a popular download, but one thing about the spreadsheet that I wanted to see if I couldn’t improve upon was just how complicated it is. In fact, Dan made every single cell its own different formula, and he ended up having to use VBA to create the formulas because maintaining and debugging it without VBA to write all those different formulas in an automated way was impossible.

As soon as I saw Dan’s spreadsheet, I wanted to make my own version of a Sudoku solver that not only used only formulas, but also one where the formulas were relatively understandable and there were a small number of distinct formulas. It turned out to not be that tough to build, but I think I learned a fair amount trying different approaches to the problems of making an iterative model like this one perform well and at the same time be reasonably maintainable and understandable. I think it might even have turned up a reasonably useful way at looking at abstraction within formulas given the Excel formula language. I’ve always wanted to blog about the process of creating this spreadsheet and about how iterative formulas work to show the power of Excel’s formula language, because it illustrates the usefulness of circular references and iterative calculation, and because I just think it’s an incredible amount of fun so here goes. Lots of people have created more powerful solvers, many as spreadsheets, some using just formulas, but I wanted to try to explain how you can go about creating a solver and hopefully share some formula tricks that people find useful.


Leave a Reply


About Microsoft Office

We’ll be discussing Microsoft Office products, the suites, updates and upgrades, tips and tricks. There are wonderful programs that Microsoft has come out with, especially Word, Excel and Outlook. There are programs for everyone out there, from home and student workers, small businesses and corporations. So, keep in contact, watch this space, as the saying goes, contact me with your tips, comments

Microsoft Office Author(s)
    » Brick-ONeil

Technology Channel Posts

  • How far do you go to be Green?
    Recycle, reduce and reuse are the hallmarks of the "Green Living" lifestyle and ecoists. There are many useful and easy to embrace ideas in going "Green". Such as recycling paper, metals, [...]
  • Expert: Microsoft Earned $1.5B From Vista Capable Program
    An expert has determined that Microsoft may have earned more than US$1 billion from its controversial Windows Vista Capable sticker program, which is still at the center of a class-action suit being [...]
  • Motorola Aura
    This new stainless steel handset is designed after luxury watches and defines artistry in the way mobile units are made and manufactured. The craftsmanship to this is unbelievably distinct. It [...]
  • The New Kids are taking Over: IE Lost Share to Firefox, Safari and Chrome in December
    Web sites saw visitors deserting Microsoft's Internet Explorer browser in favor of Apple's Safari, Mozilla's Firefox and Google's Chrome in December, according to Web analytics company Net [...]
  • A small update to the OneNote Table of Contents Powertoy
    John Guin has an update for OneNote:Over the in the OneNote Discussion Group, Mike made this request for a change to the Table of Contents Powertoy: "I have downloaded and used the TOC power toy. [...]
  • Servers Back Up on 451 Press
    Apologies for no new posts the past two days, the 451 Press Servers were offline due to a glitch. The little hamsters that power the wheels took a rest and are now fully charged and ready to go. [...]
  • Servers Back Up on 451 Press
    Apologies for no new posts the past two days, the 451 Press Servers were offline due to a glitch. The little hamsters that power the wheels took a rest and are now fully charged and ready to go. [...]
  • Happy New Year!
    I wish everyone a Happy New Year! Regular posting will resume this Monday. Thanks for continuing to visit this site. [...]
  • Tough sentences in China over huge piracy ring: Microsoft
    A Chinese court has issued tough sentences to members of a huge software counterfeiting ring, which distributed more than two billion dollars' worth of fake Microsoft goods, the company [...]
  • Office hours: Web life for grownups
    From the Office Hours Blog: Next time you're in a meeting listening to a manager who looks younger than your cat detail your role in your company's Social Media Future (aka Web 2.0), consider this: [...]

Hot Off The Press

  • Been Featured Before But Who Cares - Jason Mesnick
    I'm sure many of you who watch reality TV remember Jason as he was the one who got down on one knee to propose to Deanna Pappas and she rejected him.  Now, now he is the Bachelor and tonight he [...]
  • 10 Items or Less Returns Tonight
    The third season of the comedy 10 Items or Less begins tonight. In the season premiere, “Turkey Bowling,” there is a new general manager at the SuperValueMart who is just as determined as the [...]
  • The After Show
    I am beginning to think that MTV is adding a new element to its Reality programming and it is called The Aftershow. It seems to have started with The Hills and is apparently going to be a part of the [...]
  • Wrestling travels to Grand Canyon, hosts CS Bakersfield
    Coming off a 19th-place finish at the Midlands Championships and a day off to ring in the new year, the Arizona State University wrestling team will jump back into dual competition this weekend with [...]
  • Is TR Knight Staying on Grey’s?
    Now this is certainly interesting news. Before the holidays it was widely reported that TR Knight had asked to be let out of the remainder of his seven year contract with Grey’s Anatomy. Sources [...]
  • Streaming Jukebox: 2008's Best Songs!
    LISTEN TO A NON-STOP MIX OF 100 OF THE BEST SONGS OF 2008! THIS IS A GREAT JUKEBOX TO LISTEN TO WHEN CLEANING HOUSE, SURFING THE NET, HANGING OUT WITH FRIENDS OR KILLING TIME AT [...]
  • Laurence Fishburne Headed to CSI Miami
    Wow.  I'm not sure that William Petersen would have ever agreed to this and I'm not sure that Laurence has either but there's talk that he might head to over to CSI Miami for a crossover [...]
  • Tom Cruise and Katie Holmes go to Nobu
    Tom Cruise made Katie go out to eat a real over at Nobu last night, not sure what they really ate but I hear the place is great. The couple looked really happy and I bet she's glad to to be almost [...]
  • A Curious Case of Cynthia McKinney.
    http://smokingmirrors.blogspot.com/ According to whoever is giving you the information, Cynthia McKinney assaulted a Capitol Police officer at Congress one day… she didn't have her I.D. It [...]
  • I Wonder If They Accept References
    My hubby turns 40 this year. The BIG one. :) He's not one for parties so his sister and I are planning a get away to the mountains. How does this relate to the home zoo? Do you know how hard [...]