Format Cell based on two other cells in same row.

R

Radsan

In a decision matrix, I want to change the colour of the cells in column
range I3:I216 based on a comparison between two strings in D3:D216 and
L3:L216. The value in column D and column L can only be either "B MAJOR" or
"B MINOR".

For example I want I3 to be green if both D3 and L3 contain the same string
or red if they both contain different strings. These string values are coming
from If statements and VLookups.

I tried a helper column R where I used if(EXACT(D3,L3)=TRUE,1,0) to populate
the column with 1's and 0's. But I cannot get I3 to change colour depending
on R3 values of 1 or a 0 by conditional formatting.

It probably needs programmatic solution, but I am have no idea how to go
about writing VB code. I am at my wits end and would be grateful for any help.
 
T

Trevor Shuttleworth

On way:

Conditional Format formula for same string:

=OR(AND(D3="B MAJOR",L3="B MAJOR"),AND(D3="B MINOR",L3="B MINOR"))

I'll leave you to extend to red condition depending on your exact needs

One possibility, if the strings are always as expected:

=OR(AND(D3="B MAJOR",L3="B MINOR"),AND(D3="B MINOR",L3="B MAJOR"))

Regards

Trevor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top