How to write a Conditional Formatting Formula inside an Excel Table

GTS

Board Regular
Joined
Aug 31, 2009
Messages
108
Office Version
  1. 365
Platform
  1. Windows
Using Excel 365.

Currently stumped on this one. I don't do a lot with Excel Tables, but am reasonably familiar with Conditional Formatting.
I have a Table (named _2016-2020).
I'm trying to build in some error checking (warnings) between columns. Eg - If the Status column indicates Sold, or the Job No column has an entry, then the Inquiry column should say Job. If it doesn't, highlight it.

I've created a new (helper) column (titled Column1 for right now) that has the following formula:
=IF(AND((OR([@STATUS]="0 - SOLD",[@[JOB_NO]]<>"")),[@[INQ/Q/JOB]]<>"JOB"),1,0)
This works fine, returning 1 or 0 appropriately.

I've tried to put this formula directly into Conditional Formatting, but I get the error message "The syntax of this name isn't correct".
I've tried to add in the Table Name, but no go. Not sure if it is a syntax issue or not.
I've tried to put in a simple formula that just looks at Column1 for the 1 or 0 (T or F), but can't get it to work either. Seems it either works on one row or all rows, not row by row as I want.

Does Conditional Formatting not understand Table Structured references?
Or do I have the syntax wrong?
Something else that I'm missing?

I have several checks like this that I would like to do. There must be an approach that works. Thanks.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Two things -
  1. Conditional Format doesn't take Structured table references. rather use Cell address(es)
  2. No need to use IF statement - Use the part that results in "Yes" or "1" - That is your formula for Conditional Format
    1. Conditional Format will perform if answer is "Yes" or "1"
    2. AND((OR([@STATUS]="0 - SOLD",[@[JOB_NO]]<>"")),[@[INQ/Q/JOB]]<>"JOB")
    3. But change the references to cell address(es)
Hope it helps in some useful way
 
Upvote 0
Solution
Sanjay,

Thanks, that has resolved things. Using the cell references works.
I see that Conditional Formatting shows the same formula all the way down the column in the Table. All rows reference row 9 (the first row in my table).
Once I changed the "Applies to" to be the full range of the Table, then all worked as it should.
And a little testing indicates that adding rows to the table (at top or bottom or in between) is automatically captured (which is necessary).

Good point about not needing to wrap the AND and OR with the IF statement. Never would have thought of it that way. Makes sense though.

Appreciate the help.

GTS
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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