[Updated June 2018] I’m a big fan of Excel’s conditional formatting, and often use it to highlight cells on a worksheet. But this week I ran into a conditional formatting nightmare, and had to start from scratch. Fortunately, the fix didn’t take too long, but with complex formatting, things could have been much worse.
Separate the Dates in a List
There are lots of ways to use Excel conditional formatting. It’s useful for alerting people to problems, hiding duplicate values in a column, or even hiding cells’ contents, until related cells are filled correctly.
Earlier this year, I posted a tip for separating dates in a list, by using a red border at the start of a date change.

Easier to Read
It’s a technique that I use in one of my own workbooks, which I update every morning. The red border really makes the list easier to read, especially if I’m looking at it before my morning coffee!
The conditional formatting was set for cells A2:F9, and uses a simple formula to see if the date is equal to the date in the row above.

Quick Copy and Paste
In the workbook, I track some daily statistics for my website, and use the same headings every day. So, to save typing time, I copy and paste the headings from the day before.
For example, in the screen shot above, I could copy the regions and products headings from B2:C4, and paste them into cell B10:C12, for the latest day’s data.

The Excel table automatically expands to include the new rows, and fills in the formulas in column F. Awesome!
And that copy and paste trick is what I’ve been doing every day, for months on end.
Trouble With the Lines
Suddenly, this week, I started having trouble with the red border between dates – it wasn’t going across the full table.
So, I went into the Conditional Formatting Manager, to fix the problem. But, instead of one simple rule, there were hundreds of rules!
You can see the tiny scroll box at the bottom right in the screen shot below. That should give you some idea of how long that list was.

Every time that I copied and pasted within the conditional formatting range, it created another rule for the worksheet. Yikes!
Let’s take a look at the smaller example, where I just copied and pasted the Region and Product headings. Now, it has two rules, instead of one, after one copy and paste within the table.

Cleaning Up the Mess – UPDATED
UPDATE – March 2017: I’ve found a quicker way to fix the problem, as you can see in this video. Get the detailed steps on my Conditional Formatting page.
There is a full transcript of the tutorial following the video.
TRANSCRIPT FOR THE VIDEO
Conditional Formatting
In this workbook, I’ve got a couple conditional formatting rules, and I’m going to show you how those can get duplicated, so you end up with lots more rules than you started out with, and then how you can fix the problem.
So in this table I have two rules.
–One puts a line at the top of a date, if it’s different from the date above.
–The other rule changes the price to green, if it’s greater than $500 dollars.
We’ll take a look at those rules. In the Home tab, go to Conditional Formatting, Manage Rules.
And there you can see the two rules. They’re each applied from row 3 to 19 in this table.
–Now this one is just a cell value greater than 500.
–And this one is referring to a couple of cells. So if A2 is different from A3, we’re going to put a blue line, at the top of the cell.
How Problems Happen
And now, I’m going to insert a row, because I forgot to put in one of the records here. So I’ll click, Insert. And then just put some data in this row.
So that was a simple change to the table. And now I’m going to go back and look at my conditional formatting rules again. And suddenly I have a new rule, just for the row that I inserted.
So row 11 has its own rule, and the previous rule is still there, going from A3 to E10, and then A12 to E20. So it’s skipping this row, because that row has a separate rule.
And if you insert lots of rows, you can end up with hundreds of these rules set up, without even knowing it.
The Solution
And what I do to fix it is select all the rows, except for the first one. Then go to Conditional Formatting, Clear Rules, From Selected Cells.
Now if I go back in, and Manage Rules…I’ll go back to This Worksheet, just so we can see everything. So we’re back to those two original rules.
Then, I select the first row. I’ll select the first row in the table, this time, instead of the whole worksheet.
And go to the Format Painter, and make sure you’re selecting this first row as well, and apply that formatting to all the rows again.
And when we go back to Manage Rules, we still just have those two original rules.
If you need to do this frequently, go to my website to get a macro that removes the duplicate rules. It’s designed for data in in an Excel named table.
End Of Transcript
The previous solution is listed below, in case you’d rather try that.
Cleaning Up the Mess – ORIGINAL SOLUTION
I scrolled through the list, and deleted a few of the rules, but quickly realized that it would take far too long to delete all of them. So, to clean up the mess, I cleared the conditional formatting from the worksheet, and set it up again.

With all the extra rules gone, the conditional formatting borders were working correctly again.
Avoid Conditional Formatting Nightmare
Now, when I want to save some typing time in the daily list, I copy the previous headings, and use the Paste Values button to create the new records. I’ve got a copy of that button on Excel’s Quick Access Toolbar, so it’s easy to click.

That adds the text, and the table expands, including the formulas – but the conditional formatting doesn’t create a new rule.
Be careful out there — don’t let this conditional formatting nightmare happen to you!
Another Solution
Update: Thanks to Khushnood, who suggested leaving 3 blank rows at the bottom of the table, and inserting new rows above that, when adding new data.
Copy and pasting within the table doesn’t seem to produce the duplicate conditional formatting.
It’s still an extra step though, instead of a simple copy and paste.
________________
Hi,
I have list of weekdays from A1 to A7 (Sunday to Saturday) and a dropdown list for the same.
I would like to colour the respective weekday on the list (A1-A7) when selected from dropdown list at B1, through conditional formating
I tried the lookup formula for conditional formating as given below but not working. kindly help
=LOOKUP($B$1,$A$1:$A$7)=$A1
Very frustrating. My old version worked perfectly and made my sheet look good. Now, what a waste. BTW, Windows 8 sux.
It amazes me the arrogance of Microsoft. At one point, the power users were more or less ignored because that is not where Microsoft made most of their money. The folks who knew less would have their complaints reviewed and sometimes changed because they were paying the bills. Now, Microsoft could care less about anybody. They spend more money removing themselves from products that used to fill 10 or 12 floppy disks, but worked. Of course, now they give whatever garbage they want us to have. I’ve been using Excel since the start of Microsoft and for the best part they have come a long way. But greed is at the forefront and will continue until they come crashing down, like all giants do. We get more help from sites like Contextures and others who donate peoples time and resources to pickup the ball where Microsoft is weak. There are so many “Known Issues” with Microsoft for so many years that one must sit down while they wait, so they don’t get tired.
Thanks Paul (June 30, 2014 at 12:28 am),
Your explanation – together with some other similar references – was extremely enlightening to me.
However, unfortunately, I could not make it work.
Open question: do I need to use the indirect references in the “applies to” area ?
Here is my specific case:
1./ want to have one column with red-amber-green indicators depending on the content of the cell (eg. “R”, “A”, “G”) ; hence a pure row criterium
2./ want to “hide” the content of other cells if they are the same as then one immediately above … and on top only doing so if on another “absolute-referenced” cell the entry is “hide”
3./ I frequently want to add, copy, delete rows … (and columns occasionally)
I could – so far – not make it work without seeing the “CF-Nightmare” 😉
Hi all,
I do use an Excel sheet to do the bookkeeping for my (small) company.
For tax purposes I ry to do 90% of my business through the bank.
Therefor I have made a sheet with 2 sections. Bank transactions and Non-Bank transactions.
My ledger is symbolized by the columns, and obviously the same for both types of transactions (hence the reason they are in the same sheet)
My symptoms are similar to the ones mentioned above. My sheet contains approx. 10 conditional formats per row (is the date of the current bookyear/is it a tax booking/is the column name empty/is it an end-year-booking etc).
I have created the sheet with the rows I expect to use this year (because I already noticed the above issue when extending everything with ‘Insert copied cells’). But even when I copy paste within an existing range; this problem occurs (copy-paste_values is not a solution since I need the formula’s and copy-paste is in my blood; undo crashes Excel – reproducable error by-the-way)
My range with the formats is A1:BC1000, and when starting a year, I have the sheet with 10 formats.
Then I copy the data+fomula’s from row 10 to row 15 (for example), because both are the payment of petrol and with my formulas I only have to adjust the amount
Result is 30 conditional formats:
Range A1:BC14
Range A15:BC15
Range A16:BC1000
All 10 formulas for each range
No wonder Excel turns unworkably slow after a day’s editting.
I don’t know if I can convert everything to 2 tables and if that would solve my problems. But how do I convert it to a table?
I have issues since the move to Office2007 and meanwhile I work with 2010.
If the support would not have ended for XP, I would really consider reverting to an XP machine with Office2003 since that is by far the most stable Microsoft environment I have encountered.
Conditional formatting is a very nice feature but can drive you nuts. After repeated attempts of determining what was wrong, a VB macro was created to add the desired conditional formatting to the spreadsheet. The symptom I was experiencing prior to that was – part of the conditional logic kept disappearing. At least now I could add it back when it got lost. I kept thinking that something was overwriting the logic. The VB allowed for all kinds of testing and the only conclusion that made sense was, either the spreadsheet got corrupted or it was a bug in Excel 2010. Fortunately I also had a copy of Excel 2013. I can report that the problem was solved in 2013. BTW, I am running Fusion on a Mac Air with Windows 7. The two versions of Excel are under that. Hope this helps..
Marty,
Can you share the VB macro?