Yes. You can make an Excel hangman solver by keeping a list of possible words, entering the puzzle pattern and guessed letters, and using a formula to filter out words that do not fit. In Microsoft 365 for Windows, a helper formula can identify matching words, while a second formula can rank unguessed letters by how many remaining candidates contain them.
What an Excel hangman solver does
A spreadsheet solver does not know the answer in advance. It narrows a word list to candidates consistent with the clues you provide. For example, a four-letter pattern written as _a_e means the second letter is a and the fourth is e. If you have also guessed r and learned it is not in the word, any candidate containing r should be removed.
This approach works for a physical game, a classroom activity, or a simple game you are playing elsewhere. Excel is doing word filtering and basic probability-style ranking; it is not connecting to a game or automatically reading its screen. The quality of the result depends heavily on the list of words and on entering each clue correctly.
Excel has no built-in Hangman Solver function. The method below uses standard worksheet formulas, including SEQUENCE, which is available in Microsoft 365 and Excel 2021 or later. It does not require VBA or an add-in.
Set up the word list and puzzle clues
Create a worksheet with a dictionary of possible answers in column A. Put one lowercase word in each cell, beginning at A2, and leave A1 for a heading such as Word. Use a list with one spelling per entry and no spaces or punctuation. A larger, relevant list gives the solver more options, but a list containing obscure or unsuitable words can make its suggestions less useful.
Set up the rest of the sheet as follows:
- Enter the current pattern in C2, using an underscore for every unknown position. For example, type
_a_efor a four-letter word with a in position two and e in position four. - Enter every letter already guessed in D2, with no spaces. For example,
aemeans both a and e have been tried. - Use B1 for a heading such as Match? and put the matching formula in B2.
- Use E1 for Candidates and put the filtered-candidate formula in E2.
Keep the pattern and guessed-letter list synchronized with the game. When a correct letter is revealed, enter it in every position where it appears, not only the position you first noticed. A conventional Hangman game reveals all occurrences of a correctly guessed letter.
Filter candidates with a formula
With a candidate word in A2, the pattern in C2, and all guessed letters in D2, enter this formula in B2 and copy it down alongside the word list:
=AND(LEN(A2)=LEN($C$2),SUMPRODUCT(--(MID($C$2,SEQUENCE(LEN($C$2)),1)"_"),--(MID(A2,SEQUENCE(LEN($C$2)),1)<>MID($C$2,SEQUENCE(LEN($C$2)),1)))=0,SUMPRODUCT(--(MID($C$2,SEQUENCE(LEN($C$2)),1)="_"),--ISNUMBER(SEARCH(MID(A2,SEQUENCE(LEN($C$2)),1),$D$2)))=0)
The formula returns TRUE when the word has the right length, agrees with every revealed letter, and contains none of the guessed letters in a still-hidden position. It returns FALSE for a word that conflicts with any of those clues. The first test checks length; the next compares known positions; the final test removes candidates that would have revealed a letter already guessed.
With words in A2:A1000 and the match results in B2:B1000, enter this formula in E2 to display the remaining candidates:
=FILTER($A$2:$A$1000,$B$2:$B$1000=TRUE,"No matches")
FILTER spills the results into cells below E2, so make sure that area is empty. If the formula displays No matches, first check the pattern, guessed letters, and dictionary. The formula is designed for underscore placeholders; a question mark, hyphen, or blank space is not treated as an unknown position.
Check the solver with a small example
Suppose the word list contains only bake, cake, care, and cave. Set C2 to _a_e and D2 to ae. All four words have the right length and match the known letters. None has a or e in either hidden position, so all four remain candidates. If you add r to D2, care is eliminated because it contains r in a hidden position; bake, cake, and cave remain.
This small example also illustrates why the guessed-letter cell should include both correct and incorrect guesses. The pattern itself records where correct letters appear. D2 supplies the additional information needed to rule out a word that places a guessed letter somewhere the game would already have revealed.
Rank letters to guess next
A candidate list is useful, but it does not directly tell you which letter to try. One practical measure is how many remaining words contain each unguessed letter at least once. Put the alphabet in G2:G27, with one letter per cell. With the candidate list spilling from E2, enter this formula in H2 and fill it down beside the alphabet:
=SUM(--ISNUMBER(SEARCH(G2,$E$2#)))
The result is a count of candidate words containing the letter in G2. A letter with a higher count occurs in more of the currently possible answers, so it may be a useful next guess. Ignore letters already in D2. If there are no candidates, resolve that problem before using the counts.
This is a simple heuristic, not a guarantee of the best move. It counts whether a word contains a letter, not how many times the letter appears, and it treats every remaining candidate as equally likely. If the game has a limited number of wrong guesses, a sensible choice may balance the chance of finding a letter against the cost of an incorrect guess. The frequency count helps compare options, but it cannot account for a game’s hidden answer distribution.
Improve the word list and workflow
A solver can only choose from words it knows about. A short list may eliminate the actual answer even when every clue is entered correctly. Conversely, an enormous list can leave many plausible candidates, including words the particular game would never use. Match the list to the language, difficulty, and answer rules of the game where possible.
For a more convenient sheet, turn the word list into an Excel table by selecting it and choosing Insert > Table. A table makes the source list easier to manage and can extend when you add entries, although the example formulas above use fixed ranges and should be adjusted if your list grows beyond row 1000. You can also use Data > Sort & Filter > Filter to inspect the TRUE values in column B without relying on the spilling list.
Consider adding a separate notes area for wrong guesses, the number of mistakes remaining, or the game’s answer length. Keep the actual inputs simple: a pattern with one character per position and a compact list of guessed letters is easier to check than a collection of scattered notes. Save a clean copy of the workbook as a reusable template before entering a new puzzle.
Common problems and limitations
- No candidates appear: Check for a missing or extra underscore, a misplaced revealed letter, or a guessed letter omitted from D2. Also confirm that the answer length exists in the dictionary.
- A candidate should have been removed: Make sure D2 includes the letter and that every revealed occurrence has been entered in C2. The formula assumes the game reveals all instances of a correctly guessed letter.
- The output cannot spill: Clear any existing values below E2. Excel cannot place a dynamic-array result over occupied cells.
- The formula shows an error: Confirm that the Excel version supports SEQUENCE and FILTER and that the pattern cell is not empty. These functions are available in Microsoft 365 and Excel 2021 or later.
- The suggested letters seem odd: The count is only as representative as the candidate list. Duplicate entries can also distort a candidate list and its frequency totals.
The formulas treat letter matching without regard to capitalization, but the letter list should still be clean. Remove spaces and punctuation from dictionary entries, and avoid putting separators between letters in D2 because SEARCH checks for individual characters inside that cell. If you use a different placeholder, change the underscore tests in the matching formula consistently.
Excel versus dedicated Hangman solvers
Excel is a good fit when you want to see how the filtering works, edit the dictionary, or reuse the same workbook for different puzzles. It also makes it easy to add columns for word length, category, or custom scoring. Its trade-off is setup: the user must prepare the list, enter clues accurately, and maintain the formulas.
A dedicated online solver may be quicker for one puzzle because it can offer a ready-made word list and a purpose-built interface. However, its candidate vocabulary and rules may not match the game you are playing, and an online tool may involve sharing the pattern with a website. A paper list or a small program can be enough for occasional play. Choose Excel when transparency and customization matter more than having a ready-to-use interface.
On Excel for Mac, the formulas work in supported Microsoft 365 or Excel 2021 versions as well. The ribbon layout can differ slightly by release. The Windows shortcut Ctrl+T creates a table; on Mac, use Command+T. Excel for the web also supports many dynamic-array formulas, though available features and interface details can vary by account and update channel.
Frequently Asked Questions
Can Excel solve Hangman automatically?
It can filter a supplied list and count letters in the remaining candidates, but the player still has to enter the pattern and guesses. The worksheet does not automatically detect what appears in a separate game.
What should I put in the pattern for unknown letters?
Use one underscore for each hidden position, such as _r__ for a four-letter word with r in the second position. Do not insert spaces between the characters.
Should the guessed-letter cell include correct guesses?
Yes. Include every letter already tried, whether it was correct or incorrect. The pattern records the revealed positions; the guessed-letter list prevents a previously guessed letter from appearing in a hidden position.
Why does the solver return no matches?
The answer may be missing from the word list, or one of the clues may be recorded incorrectly. Check the word length, each known position, and the full set of guesses before changing the formula.
Can I use this in an older version of Excel?
The formulas as written rely on FILTER and SEQUENCE, available in Microsoft 365 and Excel 2021 or later. Older releases may need a different design using helper columns or VBA rather than these dynamic-array functions.
Related
- How to Add a Yes or No Checkbox in Microsoft Excel
- How to Data Validate in Excel with Drop-Down Lists
- How to Add Colour to Data Validation Cells in Excel
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Automatically Merge Duplicate Cells in Excel? What WorksExcel has no built-in command that automatically merges cells just because their values match. For repeated values in…
- How to Share an Outlook Calendar Between Two DomainsYes. You can share an Outlook calendar with someone whose email address belongs to another domain, provided your…
- How to Create a Word Template with Fillable FieldsTo create a Word template with fillable fields, build a document in Word for Microsoft 365, add content…
- Box Plot Multiple Columns in Excel: Setup and TipsTo create a box plot from multiple columns in Excel for Microsoft 365 on Windows, put each group…
- Google Sheets Auto Sort: What Changes Automatically?No—Google Sheets does not automatically re-sort a normal data range whenever a value changes. To keep a separate,…
- Excel Conditional Formatting: Color Rows by Cell TextYes. In Excel for Microsoft 365, select the rows you want to format, create a formula-based conditional formatting…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.