How to Test Conditional Formatting with a Dummy Formula
In this article
This guide shows you how to test Excel conditional formatting rules using a dummy formula—a temporary formula that always evaluates to TRUE or FALSE—so you can see exactly how your formatting will look before you apply it to real data. You’ll learn to set up a dummy formula, apply it to a test range, and verify the formatting behavior without risking your actual spreadsheet. No prior Excel expertise is needed, just a basic understanding of formulas and cell references.
What You'll Need
- Microsoft Excel (2010 or later, including Microsoft 365) or Google Sheets (the steps are nearly identical).
- A spreadsheet with some sample data, or a blank worksheet to practice on.
- Basic familiarity with Excel formulas (e.g., =A1>10) and cell references.
Step-by-Step
- Open your spreadsheet and select the range you want to test. For example, select A1:A10 if you plan to apply formatting to that column. This is the range where the conditional formatting will be applied.
- Decide on the condition you want to test. For instance, you want to highlight cells that are greater than 100. Your real formula would be
=A1>100(relative to the top-left cell of the selected range). - Create a dummy formula that always returns TRUE. In a blank cell (say C1), type
=TRUE(). This formula always evaluates to TRUE, so when you use it in conditional formatting, the formatting will apply to every cell in the selected range. This is useful to verify that the formatting itself works (e.g., the fill color, font, etc.). - Open the Conditional Formatting dialog. In Excel, go to the Home tab, click Conditional Formatting > New Rule. Choose Use a formula to determine which cells to format.
- Enter the dummy formula. In the formula box, type
=TRUE()(or reference the cell with the dummy formula, e.g.,=$C$1). If you use=TRUE(), the formatting will apply to every cell in the range. If you use a cell reference like=$C$1, it will also apply to every cell because the reference is absolute. - Set the formatting. Click the Format button and choose a fill color, font color, or border. For testing, choose something obvious like a bright yellow fill.
- Click OK to apply the rule. You should see the entire selected range highlighted with your chosen formatting. This confirms that the formatting itself is working correctly.
- Now test a real condition with a dummy twist. Instead of using a real condition, you can create a dummy formula that mimics a condition but with a known outcome. For example, to test if your formula correctly highlights values greater than 100, you can temporarily change the formula to
=A1>100and then enter a few test values in column A (e.g., 50, 150, 200). The formatting will apply only to cells that meet the condition. - Verify the relative reference behavior. The key to conditional formatting formulas is that they are relative to the top-left cell of the selected range. If you select A1:A10 and use
=A1>100, Excel automatically adjusts the formula for each cell (A2>100, A3>100, etc.). To test this, enter values in A1:A10 and see if the formatting matches your expectation. If you want to test an absolute reference, use=$A$1>100—this will check only cell A1 for all cells in the range. - Test with a dummy formula that returns FALSE. Change the formula to
=FALSE()(or=0) and apply it. The formatting should disappear from the entire range. This confirms that the rule is working—when the formula is FALSE, no formatting is applied. - Clean up. Once you’ve verified the formatting works, delete the dummy formula from cell C1 (if you used one) and replace the conditional formatting rule with your real formula. To edit the rule, go to Conditional Formatting > Manage Rules, select the rule, and click Edit Rule.
Common Mistakes
- Using absolute references when you meant relative. If you use
=$A$1>100in a rule applied to A1:A10, every cell will be formatted based on whether A1 is >100, not each cell’s own value. This is a common source of confusion. - Selecting the wrong range before creating the rule. The formula is relative to the top-left cell of the selected range. If you select A2:A10 and use
=A1>100, the formula will actually check A2 for the first cell, A3 for the second, and so on—off by one row. - Forgetting to use the formula option. If you choose “Format only cells that contain” instead of “Use a formula,” you can’t enter a custom formula like
=TRUE(). - Not testing with both TRUE and FALSE. Testing only with TRUE confirms the formatting looks right, but it doesn’t confirm the rule actually stops applying when the condition is false.
Tips
- Use a bright fill color for testing. This makes it obvious whether the rule is applied or not.
- Test on a copy of your data. If you’re working with important data, duplicate the sheet and test on the copy to avoid accidental formatting changes.
- Use the “Stop If True” option. If you have multiple rules, you can check “Stop If True” in the Manage Rules dialog to control which rule takes precedence.
- Leverage the “Applies to” box. After creating a rule, you can edit the range it applies to in the Manage Rules dialog. This is handy if you need to expand the test range.
- Use a helper column for complex conditions. If your real formula is complicated, put it in a helper column (e.g., =AND(A1>10, B1<5)) and then use that column in the conditional formatting formula (e.g., =$C1=TRUE). This makes testing easier.
Troubleshooting
No formatting appears at all. First, check that the formula is correct and returns TRUE. Use =TRUE() to test. If that works, your real formula likely returns FALSE for all cells—check the logic and the relative references. Also ensure the range in “Applies to” is correct.
Formatting appears on the wrong cells. This is usually a reference issue. Remember that the formula is relative to the top-left cell of the selected range. If you selected A2:A10, your formula should reference A2, not A1. Also check for absolute references (dollar signs) that might be locking the reference.
Formatting appears but then disappears when you close the dialog. This can happen if you have multiple rules that conflict. Check the order of rules in Manage Rules—the first rule that is TRUE wins (unless “Stop If True” is set). Also check if there is a rule that applies to the entire sheet that might override yours.
The dummy formula =TRUE() doesn’t work. In some older Excel versions, =TRUE() might not be accepted in conditional formatting. Use =1=1 instead, which always returns TRUE. Similarly, use =1=0 for FALSE.
In Google Sheets, the steps are slightly different. Go to Format > Conditional formatting, then under “Format cells if” choose “Custom formula is” and enter your formula. The relative reference behavior is the same.
Frequently Asked Questions
Q: Can I use a dummy formula to test a rule without affecting my data?
A: Yes, that’s the whole point. The dummy formula only affects formatting, not the cell values. You can apply it to a test range and then delete the rule when done.
Q: What is the difference between relative and absolute references in conditional formatting?
A: Relative references (like A1) adjust for each cell in the range. Absolute references (like $A$1) always refer to the same cell. For most conditional formatting, you want relative references so each cell is evaluated based on its own value.
Q: Why does my formula work in a cell but not in conditional formatting?
A: Conditional formatting formulas must return TRUE or FALSE. If your formula returns a number (like 1), it won’t work. Also, the formula is evaluated for each cell in the range, so make sure you’re using the correct relative reference.
Q: Can I test with multiple conditions using a dummy formula?
A: Yes, you can use a formula like =AND(TRUE(), TRUE()) to test if the AND logic works, or replace with your actual conditions. But it’s simpler to test each condition separately first.
Q: How do I remove a dummy rule after testing?
A: Go to Conditional Formatting > Manage Rules, select the rule, and click Delete. Or select the range, go to Conditional Formatting > Clear Rules > Clear Rules from Selected Cells.
Q: Does this work in Excel for Mac?
A: Yes, the steps are essentially the same. The menu names are slightly different (e.g., “Conditional Formatting” is under the Home tab, but the New Rule dialog is similar).