Projects on Excel Macro. Contribute to SumitJainUTD/VBA-MACRO-EXCEL development by creating an account on GitHub. Sudoku Solver Code in Excel Author: Ajay Keywords: Sudoku Solver Description (c) www.databison.com Please visit databison for more information. This code can be.
Hello, Here is an Excel puzzle for the popular number puzzle, Sudoku. Among the most popular strategies for solving Sudoku puzzles is that of gradually eliminating all possibilities in a given square until the correct number for that square is identified. With that in mind, suppose in an Excel spreadsheet, you create a grid as shown in Fig.
1: In this figure, each square is made up of nine cells each of which contains a single digit number. Also, to the right are nine additional squares containing much larger numbers in which the nine cells for each square have been merged. Now, what formula(s) could be used so that any time one of the large numbers is pasted into a square, that same number is eliminated in all cells which are associated by the rules of the game? For example, in Fig. 2, a large number 4 has been pasted as shown.
According to the rules, that would eliminate the possibility of a 4 being present in: 1) any other squares in the same row 2) any other squares in the same column 3) any other squares in the same 9-square box. To depict this in the figure, the 4 in each applicable square has been replaced by a small dot (obtained from the Excel Symbol chart). 3 shows the same thing but with an additional large number included: I have been playing around with formula possibilities but it is quite 'puzzling' trying to determine a formula(s) which can be pasted multiple times to fill the complete grid in order to avoid writing (9 x 9 x 9 =) 729 formulas by hand. Avoiding the circular reference warning is also puzzling. Puzzling with the puzzle of formulas to help solve the puzzle is quite puzzling but in ways, is even more fun than solving the puzzle!:-) Any suggestions ( if you are not too puzzled)?
>>Here's a Soduku solver I found on the web. Select all I tried your download solver but all it does is go right to the solution. I'm not looking for something to solve the puzzle or even help solve it but rather, sort of a display-assist that will still allow you to solve the puzzle yourself but just eliminate the time-consuming hassle of manually tracking the effects of each step.
Could you post your spreadsheet so that we could play around? This looks like fun! Select all I have attached the file (3 tabs) I used to obtain the screenshots.
However, you do understand I trust, that all of it was created manually (i.e. It's got no formulas, etc.). >>I made two separate sets of boxes - one for what you've filled in, and one for the possible choices for each box.
Otherwise I ran into problems with circular references. Yes, I also ended up going to a dual grid (i.e. One for entries and one for display) approach one time in the past. That clearly gets rid of the circular reference however I found it less than appealing, hence the search for a solution as described above.
BTW, even the most comprehensive Sudoku site I have found () utilizes a double grid. Since my last post, I put together something that is a step closer but not completely there. Nevertheless, I am attaching it in case you find it interesting/entertaining. The attached file has two tabs. One is a blank template and the other contains a puzzle. The puzzle was obtained from where puzzles are numbered and therefore can be recalled. This particular puzzle is identified by the number in the upper-right light blue box.
I think it is fairly self-explanatory--if not, just start entering numbers to see how the surrounding indicators change. All of it is automated with formulas except for the 81 large boxes for entries. Oh, and in the template, those 81 boxes are formatted to a blue font. Once I have entered the values provided in the initial puzzle, I manually change those boxes to a black font so that I can distinguish them from subsequent (blue) values I enter in solving the puzzle. Also, the 81 large boxes are collectively defined as the range: '_Big' so that all entries can quickly be erased.