To color cells that contain a word, select the cells and use Home > Conditional Formatting > Highlight Cells Rules > Text that Contains, then choose a font color. To color only the letters of a word inside a cell, select those characters while editing the cell and apply a font color manually. Excel’s standard conditional formatting colors the whole cell, not just matching characters, so choose the method that fits your goal.
The steps below are for Microsoft Excel for Microsoft 365 on Windows. You can use conditional formatting to make a color update automatically when cell contents change; partial-word formatting is a manual text format and does not update itself based on a word match.
What You’ll Need
- An Excel workbook with the text you want to format.
- The word or phrase to look for, and the font color you want to use.
- For automatic formatting, a clear idea of which cells or column should be checked. For manual formatting, use Excel desktop so you can select and format characters inside a cell.
Step-by-Step
- Decide whether to color the cell or only the word. Use conditional formatting when you want a cell’s text color to change whenever its contents include a particular word. This changes the font color of all text in matching cells. Use manual formatting when only the matching word should be colored within a longer sentence or phrase. Excel does not provide a standard conditional-formatting rule that dynamically colors only part of a cell’s text.
- Select the range to check. Click the first cell in the list and drag to select the relevant cells, or click the column letter to select the whole column. For example, if descriptions are in cells B2:B100, select B2:B100 rather than the header in B1. Keeping the range focused makes the rule easier to manage and prevents formatting unrelated cells.
- Open the text-matching rule. On the ribbon, choose Home > Conditional Formatting > Highlight Cells Rules > Text that Contains. Excel opens a small dialog with a box for the text to find and a list of formatting choices. If you want to match a cell whose entire contents are just the word, rather than any cell containing it, choose Home > Conditional Formatting > Highlight Cells Rules > Equal To instead.
- Enter the word or phrase. Type the text you want Excel to find, such as urgent, review, or shipped. The Text that Contains rule looks for that sequence of characters anywhere in the cell. For instance, searching for ship can match shipped and shipment. It is generally not case-sensitive, so a search for urgent will also match URGENT.
- Set the font color and save the rule. In the formatting choices, select Custom Format to open Format Cells. Choose the Font tab, open the Color menu, select a color, and choose OK. Choose OK again to create the rule. Excel applies the selected font color to the text in every matching cell in your selected range. If the preset formatting choices already show the font style you want, you can select one of those instead, but check that it changes font color rather than only fill color.
- Check a match and a non-match. Look at a cell containing the target text and one that does not. If neither changes, confirm that the word is spelled as expected and that the rule applies to the cells you selected. Remember that this method changes the whole cell’s font color, including any other words, numbers, or punctuation in it.
- Color only a word inside one cell, if needed. Double-click the cell, or select it and press F2, to edit its contents. Use the mouse or the arrow keys with Shift to select the exact letters you want to format. With those characters selected, choose Home > Font Color and pick a color. Press Enter to finish editing. Check that only the selected text changed; selecting a cell without entering edit mode would format the entire cell instead.
- Repeat or extend the formatting deliberately. To apply automatic highlighting for a second word in a different color, select the intended range and create another Text that Contains rule. To color several separate word instances manually, repeat the character-selection process for each one. If new rows are added later, check that the conditional-formatting range includes them; editing one cell’s manual character formatting will not automatically color the same word in other cells.
Common Mistakes
Expecting only the matching letters to change under conditional formatting. Text that Contains applies a format to the cell. If a cell says “Please review this order,” the rule colors the full cell’s text, not just “review.” Use manual character formatting when the word itself must stand out, or use a separate column to flag matches if automatic identification is important.
Searching for a fragment instead of a whole word. A search for art can also match article or partial. The built-in Text that Contains rule is a character-sequence match, not a word-boundary search. If the cell contains only the target word, use Equal To for an exact cell-content match. For words embedded in sentences, review the matches before relying on the result.
Selecting the wrong range or including a heading. A rule created while only one cell is selected may apply to just that cell. Selecting a whole column can also include a heading and unrelated future content. Select the data area you intend to format, then verify the rule’s range after creating it.
Choosing fill color instead of font color. Excel offers both. Font Color changes the letters; Fill Color changes the cell background. In the Custom Format dialog, use the Font tab and its Color menu for colored text.
Assuming manual text color will follow changed contents. If you replace or rewrite a cell, its partial-character formatting may not land on the new matching word. Manual formatting is attached to characters and their positions, not to a rule that searches for a word.
Tips
Use a distinct but readable font color, with sufficient contrast against the cell background. A very pale color can disappear when printed or viewed on a different display. If color is conveying an important status, include a label such as “Urgent” or “Review” as well; color alone is not a reliable signal for every reader.
For several target words, use a separate conditional-formatting rule for each word and give each rule a different font color. Keep a small key in the worksheet, such as “urgent = red” and “complete = green,” so the meaning remains clear. When two rules can match the same cell, check the rule order and the Conditional Formatting Rules Manager rather than assuming the color you see comes from only one rule.
To review or change a rule, select a cell in its range and choose Home > Conditional Formatting > Manage Rules. In the Rules Manager, inspect the rule, its formatting, and the range shown in Applies to. You can edit or delete rules there. If the manager is showing rules for the current selection, change Show formatting rules for to This Worksheet to inspect rules elsewhere in the workbook too.
If the data is an Excel Table, consider applying the rule to the table’s data column. Table ranges often expand as you add rows, but still verify the Applies to range after adding data. For a one-off presentation, manual formatting is fine; for a list that changes frequently, conditional formatting is easier to maintain.
Troubleshooting
The expected cells do not change color: Open Home > Conditional Formatting > Manage Rules and check Applies to. Make sure the target cells fall inside that range. Then edit the rule and check that the search text has no accidental extra spaces or misspellings. Test with a cell where the target text is visibly present. If the text was pasted with unusual characters or spacing, retype the target word in the rule and compare it with the cell.
Unexpected cells change color: Check whether the entered text is only part of a longer word. Searching for ship, for example, can match a cell containing shipment. If you need an exact match for the entire cell, replace Text that Contains with Equal To. If the target must be a separate word inside a sentence, the built-in contains rule may not distinguish it from a word that merely includes the same letters.
The rule changes the background, not the letters: Edit the rule through Manage Rules, choose Edit Rule, then Custom Format. In Format Cells, select Font and set Color. The Fill tab controls background shading and is not the setting for colored text.
The cell looks unchanged even though a rule matches: Another conditional-formatting rule may be applying a competing format, or the selected font color may be too similar to the existing color. Review all rules that apply to the cell in Manage Rules, adjust their formats or order as appropriate, and choose a clearly visible font color. Also check that the font is not hidden against the cell’s fill.
Only part of the text is not formatting manually: Make sure you are editing the cell and have selected the characters, rather than merely selecting the cell. Press F2, move the insertion point, and select the letters with Shift and the arrow keys. Apply the color while the characters remain selected. If you replace the cell’s entire contents afterward, select and format the word again.
On Excel for Mac, the same conditional-formatting approach is available from Home > Conditional Formatting; the wording or arrangement of dialogs can differ slightly by build. The Windows F2 shortcut has a Mac equivalent that can depend on keyboard settings; double-clicking the cell is a straightforward way to enter edit mode. Excel for the web also has conditional-formatting controls, though the ribbon layout may differ. For detailed character-by-character formatting, use the desktop app if the web interface does not expose the needed font controls.
Frequently Asked Questions
Can Excel automatically color just one word in a cell?
Not with the standard Text that Contains conditional-formatting rule. That rule formats the whole cell. You can manually select and color individual characters, but that formatting does not automatically follow a word when the cell changes.
Does Text that Contains distinguish uppercase and lowercase?
It normally matches without regard to case. A rule searching for complete will generally match Complete and COMPLETE as well. Check the results if capitalization matters to your workflow.
Can I give different words different colors?
Yes. Create a separate Text that Contains rule for each target word and set a different font color for each. If a cell contains more than one target, review the rules together in Manage Rules because more than one may apply.
Will the color update when I edit a cell?
Conditional formatting reevaluates the cell contents and updates its formatting when the text changes. Manual character formatting does not search for the word again, so you may need to select and recolor the new text yourself.
Can I color a word only when it appears as a whole word?
Equal To handles an exact match when the entire cell contains only that word. Text that Contains can match the same letters inside a longer word. It does not provide a word-boundary option for a word embedded in a sentence.
Does changing the font color alter the cell value?
No. Font color changes how the cell is displayed, not its text or number. The value remains the same unless you edit the cell contents.
Related
- Keep Color Formatting in Excel While Editing Data
- How to Keep Date Format in Excel
- How to Keep Duplicate Values in Excel Without Losing Data
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Shortcut Desk Mat: What It Is and How to ChooseAn Excel shortcut desk mat is a large mouse-and-keyboard surface printed with keyboard commands for Microsoft Excel. It…
- Google Sheets: How to Merge Columns Without Losing DataTo combine values from columns, put the result in a new column: with a first name in A2…
- Google Sheets COUNTIF: Count Yes AnswersTo count cells that contain the answer Yes in Google Sheets, use =COUNTIF(A2:A100,"Yes"), replacing A2:A100 with your response…
- Schedule an Email in Outlook Monthly with Power AutomateOutlook does not have a built-in option to send the same email on a monthly repeat. To automate…
- VLOOKUP in Google Sheets: How to Use ItTo use VLOOKUP in Google Sheets, enter =VLOOKUP(search_key, range, index, FALSE) in the cell where you want the…
- How to Auto Forward Emails in OutlookTo auto forward every new message in Outlook, open Settings, go to Mail > Forwarding, turn on forwarding,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.