My wife brought home a book of logic problems recently. It’s been years since I did one of these puzzles, but I think they’re fun. These are the kind where you set up a grid, like this
Then you get a series of clues to help you identify matches. The puzzle part is that you use the process of elimination to deduce relationships that aren’t explicitly given in the clues. The only thing more fun than solving these puzzles is creating a spreadsheet that makes solving them less fun. Wait, what was that again?
The above example comes from an puzzle at puzzles.com.
This spreadsheet fills in X’s when it can be determined that a relationship doesn’t exist. For instance, when you place an asterisks to indicate that Allan’s color is Brown and you’ve already determined that Allan’s month isn’t March, the spreadsheet will fill in an X to indicate that Brown’s month isn’t March. It doesn’t, however, fill in asterisks. But when you see a row or column with only one blank cell, you know what goes there.
It is setup to help solve puzzles that have four sets of five objects. Other puzzles have more or less, but this isn’t customizable for them. You could do less, you just have to fill in a bunch of X’s for the rows and columns that aren’t applicable.
It only fills in X’s when you enter an asterisk. So if you place an X in a row or column that already has an asterisk, you have to re-enter the asterisk to make sure everything’s up to date. After about the third clue, it usually isn’t necessary to do this because there’s so much redundancy in where it places X’s. I was going to have it update for placement of X’s as well as asterisks, but the latter took enough of my time that it wasn’t worth it. But if you want to know why I didn’t disable events, that’s why.
I wanted to be able to go through the clues one time and solve the puzzle. This is possible for some puzzles, but puzzles that have relative clues, like sooner/later, higher/lower, and the like, usually require a second pass.
I really had to brute force finding where the X’s go. I tried to find a cleaner algorithm, but nothing worked. So I’m looping through all the possible cells each time an asterisk is entered. It’s very fast on my machine, but your mileage may vary.
You can download LogicPuzzles.zip, which contains one xlsm file. Sorry, I don’t have a 2003 version.