Formatting Issues

Add a Custom Absence Key to an Excel Employee Schedule

Camila MilosovichCamila Milosovich Nov 14, 2026 868 views

Question details

Add a custom absence code and description to an Excel employee schedule and make the code apply a matching cell color.

Add a Custom Absence Key to an Excel Employee Schedule
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants to extend an employee absence schedule template with another absence type.
Observed behavior
Entering the new code in the roster should apply the color assigned to that absence type.
Before you start

Identify an available key cell, description cell, and the roster range where the code will be entered. Check whether the description cells are merged and review existing rules under Home > Conditional Formatting > Manage Rules.

Solution 1Recommended

Create an Absence Key and Conditional Formatting Rule in Excel

Use named ranges and a formula-based rule to color roster cells that match the new absence code.

1
Prepare the key and label

Select an available key cell, such as V2, and enter the new code. Enter its description in the adjacent label cell or merged label area, such as W2:Y2.

2
Name the cells

Select the key cell and use Formulas > Define Name to create a name such as NewAbsenceKey. Select the label cell or merged label area and define a separate name, such as NewAbsenceLabel.

3
Create the formatting rule

Select the roster range, then choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. If B5 is the active cell in the selection, enter =B5=NewAbsenceKey, then select Format and choose the fill color.

4
Check the rule range

Open Home > Conditional Formatting > Manage Rules and confirm that Applies to covers the intended roster cells. If another rule takes precedence, adjust the rule order or its Stop If True setting.

5
Test the code

Enter the new code in a roster cell and confirm that it receives the chosen color. If you changed existing codes or moved their key cells, check Formulas > Name Manager and the corresponding conditional formatting rules.

Create an Absence Key and Conditional Formatting Rule in Excel
Adjust the example formula: Replace B5 with the active cell in your selected roster range. Leave that cell reference relative so the rule checks each roster cell against the named key.
WPS Spreadsheets

Add an Absence Code in WPS Spreadsheets

Open the employee schedule in WPS Spreadsheets, define a name for the new key, and use conditional formatting to color matching roster entries.

  1. 1. Open the schedule: Open WPS Spreadsheets and use Open to select the employee schedule file.
  2. 2. Enter the key: Type the new absence code in an available key cell and its description in the adjacent label cell or merged label area.
  3. 3. Define the key name: Select the key cell and use Formulas > Define Name to name it NewAbsenceKey.
  4. 4. Set and test the color: Select the roster range and use Home > Conditional Formatting to create a formula-based rule comparing the active cell with NewAbsenceKey. Choose a fill color, apply the rule, and enter the code in the roster to test it.
Color roster cells automatically when they match the new absence codeOpen and edit Microsoft Excel XLSX filesUse named ranges to make key references easier to manageWork with a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the new absence code not change the cell color?

Open Home > Conditional Formatting > Manage Rules and check that the rule applies to the roster cell, references the correct key name, and is not overridden by an earlier rule.

How do I check which cell an absence key name refers to?

In Excel, open Formulas > Name Manager, select the key name, and check its Refers to field. Edit the reference if the key cell has moved.

Do I need to name the description cell?

The color rule only needs the named key cell if its formula compares roster entries with that key. A separate label name is useful if other parts of the template refer to the description.

What if the absence description cells are merged?

Enter the description in the merged label area and select that area when defining its name. Keep the absence code in its own key cell so the formatting rule can reference it.