Using conditional formatting with Table as reference ?

MasterBash

Board Regular
Joined
Jan 22, 2022
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table with 3 columns to be used as conditional formatting, using the table header as the color for the conditional formatting.

Unfortunately, when I add conditional formatting to my A column and use each of the named range as reference, all it does is format based on the first row below the table header.

Validation OTM vs RP test.xlsx
ABCDE
17416165Column1Column2Column3
2498479118871365778814165422226666
32222666688464519976314646411V016A88
4891919299844332634169419647982
546411V016A88MR6497226
6MR649722697141942V47
72998443344556987
8454794416599988847
918871365
102113377916
1116916149
1297141942V47
13469499
14MR6497226
158846451
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A:AExpression=$A1=Column3textNO
A:AExpression=$A1=Column2textNO
A:AExpression=$A1=Column1textNO


Because more data may be added to the table, I need to use dynamic range for conditional formatting.

Is it possible to use Conditional formatting the way I want to ?

Thank you !
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
if you just compare one cell (current row in columnA with a named range, which ois a vertical range of few cells excel just compares your Ax with first cell of that vertical range - as you already noted. so in formatting condition try counting how many times Ax occured in that range, and if count is more than 0, then there is a matching value.

so in a formatting rule instead of
Excel Formula:
=$A1=Column1
try
Excel Formula:
=countif(Column3,$A1)>0
and so on


1726902460974.png
 
Upvote 0
Solution
Instead of using =$A1=Column1, they either of the following formulas:

Excel Formula:
=COUNTIF(Column1,$A1)
=AND(NOT(ISBLANK($A1)),OR($A1=Column1))
=AND(NOT(ISBLANK($A1)),ISNUMBER(XMATCH($A1,Column1)))

COUNTIF will exclude blank cells, whereas OR and ISNUMBER-XMATCH will not, which is why the additional NOT-ISBLANK criteria is needed.

Do the same for the rules using Column2 and Column3.
 
Upvote 0

Forum statistics

Threads
1,222,569
Messages
6,166,839
Members
452,077
Latest member
hufflefry

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