Condition formatting based on TRUE/FALSE output of another cell
Solution 1
For example, this is your data:
A B
1 3 FALSE
2 2 TRUE
3 7 FALSE
4 9 TRUE
So now you want to format the text color of cell A1 and A3 to be red.
So these steps that I have tried:
- Put your cursor at A1
- In Home tab, choose Conditional Formatting, then New Rule...
- In New Formatting Rule choose Use a formula to determine which cell to format.
- Write this formula in Format values where this formula is true :
=B1=FALSE
, then set the formatting as you want by clicking Format... button. Then click OK. - Now open again Conditional Formatting, then choose Manage Rules...
- Then in Applies to change this
=$A$1
to=$A$1:$A$4
. Click buttonApply
then OK. - Now you can see text color in cell A1 and A3 are red.
Hope it is useful.
Solution 2
Your issue can be fixed using helper Column.
- Since you have not provided any sample data so that I've assumed two set of data for Tables.
How it works:
I'm assuming Table 1 has data in Range
A2:B4
and Table 2 hasD2:E6
.-
Enter this Formula in
F2
and fill it down.=AND(COUNTIF(B$2:B$4,E2)>0,D2>IFERROR(OFFSET(B$2,MATCH(E2,B$2:B$4,0)-1,-1),0))
Select
B2:B4
, reach to Conditional Formatting then New Rule and enter this Formula=$F2 =FALSE
.Apply an appropriate Format & finish with Ok.
Let me say that how the formula works:
The
COUNTIF()... > 0
part returnsTRUE
if the value in ColumnE
occurs inB2:B4
.In second part the
MATCH()
finds the position of the the data in ColumnE
Match withB2:B4
.The
OFFFSET()
finds the corresponding data in ColumnA
.IFERROR()
handles#N/A
error.If
D2
is not greater than the Data (Number) in ColumnA
, Formula returnsFALSE
.
Adjust Cell references in the Formula as needed.
Related videos on Youtube
Emma
Updated on September 18, 2022Comments
-
Emma over 1 year
I have 2 tables:
- containing values
- containing TRUE/FALSE outputs based on a formula that depends on the values of Table 1
I would like to apply condition formatting so that Table 1 cells are color RED with corresponding FALSE outputs from Table 2.
-
BruceWayne about 5 yearsConditional Formatting should do it. What have you tried?
-
Emma about 5 yearsYes I have with making my own rule but it didn't work for the whole table. I had to do it in separate sections.
-
BruceWayne about 5 yearsthat doesn't really help us here. Can you please post what you've tried, what works and what doesn't?
-
Rajesh Sinha about 5 years@Emma, could you share sample data along with Formula you have used for TRUE/FALSE, help us to fix it in better way!
-
Scott - Слава Україні about 5 yearsYou can skip steps 5 and 6 if, at step 1, you just select
A1:A4
.