Conditional formatting based on multiple columns

detriez

Board Regular
Joined
Sep 13, 2011
Messages
193
Office Version
  1. 365
Platform
  1. Windows
I am trying to format a cell when the value in a matched adjacent cell =100

I need to apply conditional format to Column A
DEF (Cell A3) and JKL (cell A5) are formatted because the thier score in Column H =100

If A.value = G.value and H.value = 100
Then Set Formula


1616031880279.png
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I've got the first part working

VBA Code:
=MATCH(A2,G2:G5,0)

Now I need to add to this..... AND Score=100
 
Upvote 0
Try this. Use a lookup function (I used Vlookup), if found and 100 return true otherwise return false.
You don't need column B that was just my workings before moving the formula into the conditional formatting box.

20210318 Conditional Formatting with Vlookup.xlsx
ABCDEFGHIJK
1DataValueScore
2ABCFALSEXYZ100
3DEFFALSEDEF200
4GWFFALSEsecond300
5JKLFALSEJKL100
6
Finished
Cell Formulas
RangeFormula
B2:B5B2=IFERROR(VLOOKUP(A2,$I$17:$J$20,2,FALSE)=100,FALSE)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A5Expression=IFERROR(VLOOKUP(A2,$I$2:$J$5,2,FALSE)=100,FALSE)textNO
 
Upvote 0
Solution
If you want to make it smarter.
1) Put the 100 in a cell and give it a meaningful rangename, this will mean you can change the 100 to something else should you need to.

2) convert the score table into an Excel Table and give it a meaningful name.
This will mean it will expand and contract with the number of rows in the table so you don't have to modify the conditional formatting formula.
In the below I have changed the table name from Table1 to tbl_Score

20210318 Conditional Formatting with Vlookup.xlsx
ABCDEFGHIJK
1DataValueScore
2ABCFALSEXYZ100
3DEFFALSEDEF200
4GWFFALSEsecond300
5JKLTRUEJKL100
6
With Table
Cell Formulas
RangeFormula
B2:B5B2=IFERROR(VLOOKUP(A2,tbl_Score,2,FALSE)=100,FALSE)
Named Ranges
NameRefers ToCells
tbl_Score=Table1[#All]B2:B5
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A5Expression=IFERROR(VLOOKUP(A2,tbl_Score,2,FALSE)=100,FALSE)textNO
 
Upvote 0
Brilliant Alex.. lookup never occured to me.
Works exactly as expected

Thanks, I appreciate your help
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,806
Members
449,048
Latest member
greyangel23

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