Forum Discussion
lucasbucholz
Oct 15, 2019Copper Contributor
Stop conditional formatting at the end of the data
I have conditional formatting on a data set from a power query. Part of the conditional formating is "if a cell is blank" formating. I have this selected for the entire column. Is there a way to stop the formating after the end of the data table? When I filter the data down the formating continues past the end of the data. Is there a way to reference another cell to stop the conditional formatting. i.e. if cell A2 is blank apply no formating to C2? But I need C1 to be formatted as a blank cell if A1 has data in it.
Basically I have the blanks highlighted red but when filtering down the data the cells below everything is still showing a bunch of red rows.
2 Replies
Sort By
It's better to use conditional formatting rules with formulas. For example, to highlight blank cells in the range $H:$AI and not highlight cells if entire row in this range is empty, formula could be
=ISBLANK(H1)*COUNTA($H1:$AI1)
Another topic is that better to follow the rule one "color - one rule", not "one condition - one rule". If to highlight with the same color blank cells and cells with the value "No", above formula could be modified as
=ISBLANK(H1)*COUNTA($H1:$AI1)+(H1="No")
- JKPieterseSilver ContributorTheoretically you should not have to format the entire column, just format the data area of the table. Excel should automatically expand and contract the formatting with the size of your table.