How to Display Text Based on Conditional Formatting Colors in Excel
Question details
The user wants to display specific text characters (like shift codes M or A) in calendar cells based on their conditional formatting colors without replacing the existing cell formulas.

- Product
- Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Managing a shift calendar template with formulas and color-coded conditional formatting.
- Observed behavior
- The user needs the cells to display custom text corresponding to the conditionally formatted color, preserving the background formula calculations to prevent template damage.
Before modifying conditional formatting rules or custom formats, ensure you highlight the correct range of cells in your shift calendar to avoid applying changes to unintended areas.
Apply a Custom Number Format in Conditional Formatting
Modify existing conditional formatting rules to apply a custom number format, which visually changes the cell display to text without deleting the underlying formula.
Select the target cells in your calendar. Go to the Home tab, click on Conditional Formatting, and choose Manage Rules from the dropdown menu.
In the Rules Manager dialog, select the rule that applies the blue color (for example) and click Edit Rule.
Click the Format button, navigate to the Number tab, and select Custom from the category list on the left.
In the Type box, enter "M";"M";"M";"M" (including the quotes) to force the cell to display 'M' regardless of its numeric value. Click OK to apply the changes.
Repeat this process for the pink rule, entering "A";"A";"A";"A" as the custom format, and apply all changes.

Modify the Underlying Cell Formulas
If adjusting conditional rules is not preferred, you can rewrite the cell formulas to return specific characters directly based on logical conditions.
Use Find and Replace by Formatting
Search for cells matching a specific background color and replace their contents with text.
Seamlessly Manage Conditional Formatting with WPS Spreadsheet
WPS Spreadsheet offers an intuitive rule manager that makes adjusting conditional formatting and applying custom number formats effortless, ensuring your complex calendar templates work flawlessly.
- 1. Open Your Calendar Template: Launch WPS Spreadsheet and open your existing shift calendar document.
- 2. Access the Rule Manager: Select your data range, navigate to the Home tab, click Conditional Formatting, and select Manage Rules.
- 3. Apply Custom Display Text: Select the specific color rule, click Edit Rule, navigate to the Custom Format tab, and input your specific display characters.

Frequently Asked Questions
Will applying a custom text format break my sum calculations?
No. Custom number formats only alter how the value is displayed on the screen. The underlying number or formula remains completely intact and can still be used accurately in calculations like SUM or COUNT.
Why does manually typing the letter 'M' ruin my calendar template?
Manually typing text into a cell overwrites the underlying formula that the template relies on to function. Using custom number formats within conditional formatting safely changes the appearance without deleting the necessary background formula.
Can I use conditional formatting to change text color instead of displaying new text?
Yes. In the Conditional Formatting rule setup, instead of modifying the Number format, you can navigate to the Font tab to simply change the text color based on your required conditions.




