Add a Custom Absence Key to an Excel Employee Schedule
Question details
Add a custom absence code and description to an Excel employee schedule and make the code apply a matching cell color.

- 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.
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.
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.
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.
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.
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.
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.
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.

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. Open the schedule: Open WPS Spreadsheets and use Open to select the employee schedule file.
- 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. Define the key name: Select the key cell and use Formulas > Define Name to name it NewAbsenceKey.
- 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.

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.




