Chart & Visualization Issues

How to Color Excel Cells Containing X Using Conditional Formatting

Bushra ParveenBushra Parveen Nov 2, 2026 868 views

Question details

Highlight specific cells containing the letter 'X' to mark days off in a shift work calendar.

How to Color Excel Cells Containing X Using Conditional Formatting
Product
Excel
Device & OS
not provided
Scenario
Setting up a shift work calendar where different shift patterns and days off (marked with an X) need distinct background colors for visual clarity.
Observed behavior
The user needs to automatically fill color in specific cells indicating an 'X' to distinguish them from the rest of the shift schedule.
Before you start

Ensure your calendar template is open and identify the exact cell ranges representing your schedule where the rules need to be applied.

Solution 1Recommended

Use Formula-Based Conditional Formatting

Create a custom formula rule to accurately identify and color cells containing exactly the letter 'X'.

This method gives you complete control over how the formatting is applied and is highly adaptable if you need to build more complex logical conditions later.

1
Select the Calendar Range

Highlight the entire grid of cells in your calendar where you track the shift patterns and days off.

2
Open Conditional Formatting

Navigate to the 'Home' tab on the top ribbon, click on 'Conditional Formatting', and select 'New Rule'.

3
Enter the Formula

Select 'Use a formula to determine which cells to format'. In the formula box, type =A1="X" (replace A1 with the actual reference of the top-left cell in your highlighted range).

4
Set the Fill Color

Click the 'Format' button, go to the 'Fill' tab, choose your desired background color (e.g., white or gray for days off), and click 'OK' to apply the rule.

Use Formula-Based Conditional Formatting
Relative References: Ensure you do not use absolute references (like $A$1) in the formula. Using relative references (like A1) ensures the rule evaluates every cell in your selection individually.
Efficient Spreadsheet Tool

Easily Highlight Calendar Cells in WPS Spreadsheet

WPS Spreadsheet features robust, intuitive conditional formatting tools that are completely compatible with Microsoft Excel. You can quickly color-code schedules, shift patterns, and text-based entries with a few simple clicks.

  1. 1. Open the Calendar: Launch WPS Spreadsheet and open your shift schedule document.
  2. 2. Select the Schedule: Highlight the date cells that you want to apply the formatting to.
  3. 3. Apply Conditional Formatting: Navigate to Home > Conditional Formatting > Highlight Cells Rules > Text that Contains.
  4. 4. Set Text and Color: Enter 'X' into the criteria box, select your desired fill color, and click OK to instantly update your calendar.
100% compatible with Microsoft Excel conditional formatting rulesIntuitive interface for managing multiple cell rules simultaneouslyFree, lightweight, and fast spreadsheet processingCross-platform support to view your schedules on PC and mobile
microsoft office alternative - wps office

Frequently Asked Questions

Can I apply different colors for the three different shift patterns?

Yes. You can layer multiple conditional formatting rules over the same range of cells. Simply repeat the 'New Rule' process, applying different formulas or specific text criteria for each shift pattern, and choose a unique fill color for each.

Do I need to create a separate rule for every single month?

Not necessarily. If your months are on the same worksheet, you can select all the monthly grids simultaneously by holding the Ctrl key, and then apply the rule once. Alternatively, use the 'Manage Rules' dialog to manually expand the 'Applies to' range to include all months.

Why is the color only applying to the first cell and not the rest of the calendar?

This usually happens if your formula uses absolute referencing. If you typed =$A$1="X", Excel locks the evaluation to that exact cell. Change it to =A1="X" so the rule dynamically checks every cell in the selected range.