Can a Conditional Formatting Formula Be Stored in a Cell/Cells on the Spreadsheet and Still Work?

MEUserII

Board Regular
Joined
Oct 27, 2017
Messages
91
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Platform
  1. Windows
I would like to know if it's possible to store a conditional formatting formula in a cell/cells on the spreadsheet, and still have it work?

For example, consider the cells:
[TABLE="width: 250"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]A[/TD]
[/TR]
[TR]
[TD="align: center"]Row 2[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]Row 3[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]Row 4[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]4[/TD]
[/TR]
</tbody>[/TABLE]

If the formula:=ISNUMBER(A1) is entered with condition: fill - yellow as a conditional formatting formula where the range in the conditional formatting rule is set to A1:B4 then the effect will be the following fill effect (fill effect denoted in brackets).

[TABLE="width: 250"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[/TR]
[TR]
[TD="align: center"]Row 1[/TD]
[TD="align: center"][YELLOW][/TD]
[TD="align: center"][NO COLOR][/TD]
[/TR]
[TR]
[TD="align: center"]Row 2[/TD]
[TD="align: center"][NO COLOR][/TD]
[TD="align: center"][YELLOW][/TD]
[/TR]
[TR]
[TD="align: center"]Row 3[/TD]
[TD="align: center"][YELLOW][/TD]
[TD="align: center"][NO COLOR][/TD]
[/TR]
[TR]
[TD="align: center"]Row 4[/TD]
[TD="align: center"][NO COLOR][/TD]
[TD="align: center"][YELLOW][/TD]
[/TR]
</tbody>[/TABLE]

However, this requires that the conditional formatting formula is stored in the Conditional Formatting Rules Manager, so the question is this: is there a way to have this conditional formatting formula stored on the spreadsheet in some cell or cells, and still have the conditional formatting effect (fill yellow) of the conditional formatting formula work for range A1:B4 without being directly stored in the Conditional Formatting Rules Manager?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
My first question is why?
 
Upvote 0
The big question is, why do you want to do it this way? In order to use Conditional Formatting, you will need to use Conditional Formatting rules (no way around that).

If you did not want to store the Conditional Formatting Formulas in Conditional Formatting, you could store the formula in cells, and then apply the Conditional Formatting Rules, but that would still be a formula, in an of itself.

For example, let's say that you store the =ISNUMBER(A1) formula to cell C1.
Then you would select cell A1, and enter the following formula for CF:
Code:
=C1

The caveat to using this method is:
- you are still, in fact, using CF formulas
- you would need to have a separate formula on you worksheets for every single cell that you wanted to apply Conditional Formatting to (i.e. need to enter a formula for A2 in C2, A3 in C3, etc)

The other alternative to not using Conditional Formatting at all is to use VBA.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,986
Messages
6,175,789
Members
452,670
Latest member
nogarth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top