Conditional Formatting did not work with SumProduct and Search array formula

freelensia

New Member
Joined
Jul 2, 2017
Messages
18
Hi,

I have a table called BadSyntaxTbl with a column called Bad Syntax.
It looks like this:

Bad Syntax
<!-- b-->< /b>
% {

I want to apply conditional formatting to a range of cells. The formatting would apply when any of the terms in Bad Syntax column are found anywhere in the formatted cell.

So for example, the cells below would trigger the conditional format:
I love the website < b> Freelensia.com < /b>.
Welcome to % {service_name}, a place to reserve interpreters online.

I came up with this formula:
=SUMPRODUCT(--ISNUMBER(SEARCH(BadSyntaxTbl[Bad Syntax],N3)))>0
where N3 is the first cell I want to apply the format to.

I have tested this formula by inputting it in a normal cell. It returned TRUE / FALSE correctly.

However when I put this in a conditional formatting rule, Excel tells me to check my formula again and refuses to process it.
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Structured references don't work in a conditional formatting rule.
Use regular references like $A$2:$A$3

M.
 
Upvote 0
Ah right! How dumb am I! I will solve this with an Indirect formula instead. Thanks!

A workaround without Indirect (a volatile function)

Create a named range, say MyRange, using a formula
Name: MyRange
Refers to: =INDEX(BadSyntaxTbl[Bad Syntax],0)

(this range is updated automatically when new rows are added to the table)

Then you can use this formula in CF
=SUMPRODUCT(--ISNUMBER(SEARCH(MyRange,N3)))>0

M.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,749
Members
448,989
Latest member
mariah3

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