Nov 15 2017 12:21 AM
Hi,
I sometimes use conditional formatting. For each entry, there's a cell range that it applies to. Often I need it to be used on the entire sheet, or at least a large range of it, i.e. all rows that have content.
But then I need to insert or remove data, and that mucks up the range. It seems to copy the entry to the range above, the inserted range, and the range below. I want it to keep the range and entries as they are when I edit the sheet's data.
How?
I usually enter the range as e.g. $1:$1048576 or $A:$XFD.
May 19 2022 06:49 AM
@OldGitSean that's correct, inserting data into the middle of the range will cause the formatting to be modified. Only works if you are extending the range to new cells at the end of the range.
Aug 23 2022 04:12 AM
I don't call myself an "Excel Expert" by any means, but I like to struggle with things until I find some sort of simple solution.
In my case, I have 3 x CF rules applied to 2 different columns in a table, as example: "=$Q$2:$Q$185"...
As soon as I insert a row, it splits the "Applied to" range, and add a set of 3 new rules. But if I add a row to the very bottom of this table and apply my "custom sort" instruction, the range gets extended to "=$Q$2:$Q$186"...
This is what worked for me and hope someone can also make use thereof.
Aug 29 2022 03:43 AM
Jan 11 2023 04:26 AM
I figured it out. My example is column-based formatting and when inserting a new column the static cell formula and conditional formatting ($I$10) becomes $J$10 which I do not want.
I found that making the formulas and CF as I$10 then inserting a new column and dragging it over (becomes J$10) then deleting my column will re-align the J$10 to become the original I$10. This applies to the CF as well.
Took a little longer than I hoped to get this working and it was a pain. Excel should respect static cell inputs or make absolute static cell inputs (e.g. $$I$$10) so it is respected no matter what happens to the sheet elsewhere.
Jan 11 2023 06:11 AM
Feb 05 2023 01:43 AM
Hi, same problem here. Working with 3 x 30'000 datasets in one sheet we have to insert singular sets of 8 rows (example K-R) per line v downwards. Excel always presses preference >rightwards.
Whole blocks of columns destroyed
Tried to re-edit the dialog box into permanent "downwards" option, no chance.
If you'd find any solution, please get in touch.
Feb 05 2023 02:40 AM
I suspect the problem is that conditional formatting is an antiquated piece of junk that will take a fortune to sort out. You are more likely to get added 'bells and whistles' than a substantive rewrite.
The main challenge now is to create something that works well with dynamic arrays (I use 365 and my solutions comprise nothing but names and dynamic arrays). If I create a dynamic array of formats (which may cover header rows, numeric results, white space between output blocks), I want it to apply to the range used by the dynamic array, whatever that happens to be at the time.
May 08 2023 09:18 PM
For a year now I've been redoing the conditional formatting every couple of days. Yes, It's crazy this hasn't been addressed. The same thing happens with the Data Validation, inserting lines stops that from working and I have to manually set it again.
It feels like we're using Excel in the year 2000, a spreadsheet for the new millennium! The new AI stuff makes bad design like this seem so out of place in 2023.
May 24 2023 01:47 PM - edited May 24 2023 01:50 PM
I have a situation where I have one column formatted and I am just cutting and pasting cells from the other columns to a different line. No column or row insertion, simple cut/paste. The format only applies to column F. So I am highlighting A-D of one row, say 15, and I cut, then past the values onto row 10.
I can tell right away that it's screwing things up, as the paste triggers the CF to turn column F green if it matches column A.
It somehow still screws up my conditional formatting that is only on column F.
Explain that one!
May 24 2023 11:01 PM - edited May 24 2023 11:05 PM
@kennnels - instead of "cutting" or even dragging the data to a new position, I would rather copy and paste as value(V).
If you think about it, you are physically moving the reference of the formula in F15, to a new position. Therefor the original formula of F15 will autocorrect it self and will now reference the data in row 10.
As an example, I created a table A2:B9. I use a formula (=A2*$A$1) throughout a entire column B, to reference a value, originally positioned in A1. If I "CUT" A1 and paste the data in A20, the formula of the entire column will autocorrect as (=A2*$A$20) and all values will still be calculated correctly. Even if you move the entire table to column Z, the formula autocorrect to (=Z2*$Z$20)
In many cases, this is what you would want, but in your situation, you should rather just copy and paste as value(V).
PS: I am no expert and stand to be corrected...
Aug 10 2023 08:16 AM
I had the same issue. The solutions suggested in this blog didn't work for me since the formatted range included only several columns in the middle of the worksheet, but excluded other populated columns to the left/right. My solution was to write a quick macro that selects the formatting range, deletes all current conditional formats, then rewrites the format I want. It's easier for me to run the macro than to manually reset the formatting range after every edit. Clearly not a solution for everybody.
Aug 21 2023 11:33 AM
Call me crazy but IMO if I specify $E:$E in a conditional format, it should remain $E:$E regardless of adding or removing rows.
Aug 22 2023 12:50 AM
@stacyalabardo Adding or removing rows will not affect a reference like $E:$E as that points to all rows. Try a regular SUM formula like that in a cell and start adding rows. Watch the formula. CF formulas work exactly the same.
Aug 22 2023 06:05 AM
@Jan Karel PieterseThank you for responding! Unfortunately, that hasn't been the case with my version of Excel for Mac, Version 16.76 (23081101) on my 13-inch, 2020, 2.3 GHz Quad-Core Intel Core i7 MacBook Pro with 16 GB of RAM. This is happening in a shared file across a network. Does that make a difference given that everyone probably doesn't have the exact same computer as me? Also, some of those folks use the browser version of Excel. Could that be the reason? It happens mostly when a row is deleted. Your expertise would be helpful. TIA
Aug 22 2023 06:08 AM
Aug 22 2023 06:40 AM
Aug 22 2023 07:01 AM
Aug 22 2023 07:15 AM
@stacyalabardo Microsoft issued a fix quite recently for this for Windows Excel. I am not sure if this was also implemented for Mac (or on-line).
Does it work any better if you apply the CF rule to a range formatted as table?
Aug 22 2023 07:24 AM