Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Add Color to Excel Data Validation

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To put color in data validation in Excel, you cannot color the validation rule itself. Instead, you apply conditional formatting to the same cells, using a formula that checks whether the cell's value meets your validation criteria. The color then appears automatically when a user enters valid or invalid data. This guide walks you through the process step by step, using Excel's built-in tools. No add-ins or macros are required.

What You'll Need

  • Microsoft Excel (any modern version: Microsoft 365, Excel 2019, 2021, or 2024) on Windows or Mac. The steps are nearly identical; where they differ, it is noted.
  • A worksheet with data validation already set up, or the willingness to set it up as part of this process.
  • Basic familiarity with Excel formulas (e.g., A1-style references).

Step-by-Step

  1. Select the cells that already have (or will have) data validation. For example, select B2:B100 if that range contains a dropdown list or a whole-number rule. If you have not yet applied validation, do that first: go to the Data tab, click Data Validation, set your criteria (list, whole number, date, etc.), and click OK.
  2. With the same cells still selected, open Conditional Formatting. On the Home tab, click Conditional Formatting > New Rule. (On Mac, the path is Home > Conditional Formatting > New Rule.)
  3. Choose "Use a formula to determine which cells to format." This option appears near the bottom of the New Formatting Rule dialog.
  4. Write a formula that mirrors your validation rule. The formula must return TRUE for cells you want to color. For a list validation in B2:B100 where the allowed values are in a range named MyList, use: =COUNTIF(MyList,B2)>0. For a whole-number rule between 1 and 100, use: =AND(ISNUMBER(B2),B2>=1,B2<=100). For a date rule, use: =AND(ISNUMBER(B2),B2>=DATE(2025,1,1),B2<=DATE(2025,12,31)). Important: the formula must refer to the top-left cell of your selection (B2 in this example) and use relative references (no dollar signs on the row/column unless you intend absolute references).
  5. Click Format, then go to the Fill tab. Pick a background color (e.g., light green for valid entries). You can also set a font color or border on the Font and Border tabs. Click OK to close the Format Cells dialog.
  6. Click OK again to apply the rule. The selected cells should now show the color wherever the formula is TRUE. Cells that fail the formula remain uncolored.
  7. To color invalid entries instead (or as well), repeat steps 2–6 with a second rule. Use the opposite formula: for the list example, =COUNTIF(MyList,B2)=0; for the number example, =NOT(AND(ISNUMBER(B2),B2>=1,B2<=100)). Choose a red fill. If both rules apply to the same cells, ensure the invalid rule is listed first and has "Stop If True" checked (in Conditional Formatting > Manage Rules) so it takes priority.
  8. Test the colors. Type a valid value into one cell and an invalid value into another. The valid cell should turn green (or your chosen color) and the invalid cell red. If nothing changes, check that the formula references the correct top-left cell and that the cell values match the validation type (e.g., numbers are not stored as text).
  9. Adjust or remove rules later. Go to Home > Conditional Formatting > Manage Rules. Select "This Worksheet" to see all rules. You can edit the formula, change the fill color, or delete a rule. Changes apply immediately.

Common Mistakes

  • Using absolute references in the formula. If you write =COUNTIF(MyList,$B$2)>0, every cell will check B2 instead of its own value. Use relative references (B2) so the formula adjusts per cell.
  • Forgetting that data validation and conditional formatting are separate. Coloring the validation rule itself is not possible; the color must come from conditional formatting. Do not expect the Data Validation dialog to offer fill colors.
  • Mismatching the formula logic. The conditional formatting formula must exactly mirror the validation criteria. For example, if validation allows decimals between 0 and 1, a formula that checks only integers will color valid decimals as invalid.
  • Applying the rule to the wrong range. Select the same range as your validation, or at least a range that starts at the same top-left cell. If the ranges differ, the relative references will point to the wrong cells.
  • Overlooking text vs. number formats. If validation expects numbers but cells are formatted as Text, the conditional formula may not evaluate as expected. Ensure the cell format matches the data type.

Tips

  • Use light fills (pastels) so text remains readable. Strong colors can obscure the cell content.
  • For dropdown lists, consider coloring the cell green when a value is selected and red when blank or invalid. Use =B2="" for blank detection.
  • If you need multiple colors for different valid ranges (e.g., low/medium/high), create separate rules with formulas like =AND(B2>=1,B2<=33), =AND(B2>=34,B2<=66), etc.
  • Copy the conditional formatting to other sheets by using the Format Painter or by copying the cell and using Paste Special > Formats.
  • Keep formulas simple. Complex formulas are harder to debug; break them into helper columns if needed.

Troubleshooting

  • No color appears at all. Check that the conditional formatting rule is enabled (Manage Rules > check the "Stop If True" and rule status). Also verify the formula returns TRUE for a test cell by entering it in a blank cell and pressing Enter.
  • Color appears in wrong cells. The formula likely uses absolute references or refers to a different top-left cell. Edit the rule and ensure the reference matches the first cell of your selection.
  • Color does not update when values change. Conditional formatting recalculates automatically, but if calculation is set to Manual, press F9. Also check that the cell values are not stored as text (use ISTEXT to test).
  • Validation dropdown disappears after adding conditional formatting. This should not happen; conditional formatting does not affect validation. If it does, check that you did not accidentally overwrite the cells or clear validation. Reapply validation if needed.
  • Rules conflict. If multiple rules apply, the first rule in the list wins unless "Stop If True" is set. Reorder rules in Manage Rules to prioritize the most important color.

Frequently Asked Questions

Can I color the data validation dropdown list itself?

No. Excel does not provide a way to change the background color of the dropdown list that appears when you click a validated cell. You can only color the cell based on its value using conditional formatting.

Do I need to use VBA or macros to add color to data validation?

No. Conditional formatting is a built-in feature and requires no code. It works in all modern Excel versions.

Will the color appear when I print the worksheet?

Yes, conditional formatting colors print by default. If they do not, check Page Layout > Print Titles > Sheet > Print > Black and white (uncheck it) and ensure "Draft quality" is off.

Can I use conditional formatting with data validation on a protected sheet?

Yes, but you must unlock the cells before applying conditional formatting, or apply the formatting before protecting the sheet. Once protected, users cannot change formatting but the colors will still display.

Why does my conditional formatting formula work in a cell but not in the rule?

Conditional formatting formulas evaluate relative to the top-left cell of the applied range. If you tested the formula in a different cell, the references may not match. Always write the formula as if it were in the top-left cell of your selection.

Can I apply multiple colors based on different validation rules?

Yes. Create separate conditional formatting rules for each color and condition. Use Manage Rules to set priority and ensure they do not conflict.