Need to check color true and false

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
996
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team
I have data L6 to M17 (pulled from Excel) and Q6 to R17 (pulled from a PPT file) and i want to cross-check the color by true and false
if the color not match i need false in (W6 to X17)

FS.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXY
1Datan7Site All Hits: Hulu0434p
2Weight Details244550r
3Weighting SchemeMid Campaign SLW 6/1/22-9/30/22893q
4slide 18ControlDeltaExcelPPT
5
6Data155Unaided Brand Awareness - First Mention1%+0.210.2TRUETRUE
7Site All Hits: HuluData155Unaided Brand Awareness - Any Mention19%+0.2190.2TRUETRUE
8Brand MetricsControlExposedDeltaData155Unaided Brand Awareness - Other Mentions18%+0.1180.1TRUETRUE
9Unaided Brand Awareness - First Mention1.3%1.5%0.2%Data155Aided Awareness96%-0.996-0.9TRUETRUE
10Unaided Brand Awareness - Any Mention18.8%19.0%0.2%Data155Total Ad Awareness33%+13.43313.4TRUETRUE
11Unaided Brand Awareness - Other Mentions17.5%17.6%0.1%Data155Online Ad Awareness20%+8.1208.1TRUETRUE
12Aided Awareness96.2%95.4%-0.9%Data155CTV Ad Awareness 8%+3.483.4TRUETRUE
13Total Ad Awareness32.6%46.0%13.4%Data155Message Association - "We Got Now"9%+1.191.1TRUETRUE
14Online Ad Awareness20.0%28.1%8.1%Data155Brand Favorability57%+1.4571.4TRUETRUE
15CTV Ad Awareness 8.3%11.7%3.4%Data155Consideration Intent49%+6.2496.2TRUETRUE
16TV Ad Awareness8.5%11.7%3.2%Data155Recommendation - T3B33%+8.4338.4TRUETRUE
17Social Ad Awareness16.8%27.3%10.5%Data155Recommendation - B3B11%+2.1112.1TRUETRUE
18Message Association - "We Got Now"8.9%10.0%1.1%324/648
19Brand Favorability56.7%58.0%1.4%
20Consideration Intent48.9%55.1%6.2%[Mediahub New Balance_Banner Books Data for DD Charting.xlsx]Banner Book 141100n324648324/648TRUETRUE
21Recommendation - T3B32.7%41.0%8.4%324/648
22Recommendation - B3B11.0%13.1%2.1%
23Net Promoter: Promoter20.9%28.7%7.8%
24Net Promoter Score-34.3%-19.0%15.3%
25Net Promoter: Passive23.9%23.6%-0.3%
26Net Promoter: Detractors55.2%47.7%-7.5%
27n324648648
28
29
30BD
3124
32
33Unaided Brand Awareness - First Mention929
34Unaided Brand Awareness - Any Mention10215
35Unaided Brand Awareness - Other Mentions11215
36Aided Awareness1229
37Total Ad Awareness13243
38Online Ad Awareness14245
39CTV Ad Awareness 15245
40Message Association - "We Got Now"18215
41Brand Favorability19215
42Consideration Intent20243
43Recommendation - T3B21243
44Recommendation - B3B22215
45
Data
Cell Formulas
RangeFormula
H1H1=H3-1
L1:M1L1=INDEX(INDIRECT("'"&$G$6&$H$6&"'!A1:IV100"),$H$1,L$2)
W1:X3W1=Getfillcolor(W1)
M2M2=L2+2
H3H3=MATCH("Control",INDIRECT("'"&$G$6&$H$6&"'!B:B"),0)
L4:M4L4=INDEX(INDIRECT("'"&$G$6&$H$6&"'!A1:IV100"),$H$3,L$2)
L6:L17,L20L6=INDEX(INDIRECT("'"&$G6&$H6&"'!A"&$I6&":IV"&$J6&""),MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0),L$2)
M6:M17M6=INDEX(INDIRECT("'"&$G6&$H6&"'!A"&$I6&":IV"&$J6&""),MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0),M$2)*100
W6:W17W6=ROUND(L6*100,0)=Q6
X6:X17X6=ROUND(M6,1)=R6
G20G20=VLOOKUP($G$4,Sheet3!$A$2:$C$25,2,0)
H20H20=VLOOKUP($G$4,Sheet3!$A$2:$C$25,3,0)
M20M20=INDEX(INDIRECT("'"&$G20&$H20&"'!A"&$I20&":IV"&$J20&""),MATCH($K20,INDIRECT("'"&$G20&$H20&"'!A"&$I20&":A"&$J20&""),0),M$2-1)
Q20Q20=Q18
W20:X20W20=L21=Q20
L21L21=L20&"/"&M20
L30:M30L30=CHAR(L31+64)
L31:M31L31=L2
J33:J44J33=K6
K33:K44K33=MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0)
L33:M44L33=Getfillcolor(INDIRECT("'"&$G6&$H6&"'!"&L$30&$K33&""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
W6:Z20Cell Valuecontains "f"textNO
L4:N5,P4:P5,U4:Z5Cell Valuecontains "Delta"textNO
K33:K67Cell ValueduplicatestextNO
M6:M19Expression=M33=$W$1textNO
M6:M19Expression=M33=$W$2textNO
M6:M19Expression=M33=$W$3textNO
Cells with Data Validation
CellAllowCriteria
G4List=Sheet3!$D$2:$D$99
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Since you already have a UDF for GetFillColor, you should be able to use:

W6=(GetFillColor(L6) = GetFillColor(Q6)) copied down and right.
 
Upvote 0
Since you already have a UDF for GetFillColor, you should be able to use:

W6=(GetFillColor(L6) = GetFillColor(Q6)) copied down and right.

Hi Oaktree,

Thanks for your time on this i have tried as per the above Function but not able to get the exact data for color pleae findhte Screen shot

1667505293833.png
 
Upvote 0
*Are* they actually the same? If you put =GetFillColor(M6) in one cell and =GetFillColor(R6) in another cell, what does each return?
 
Upvote 0
*Are* they actually the same? If you put =GetFillColor(M6) in one cell and =GetFillColor(R6) in another cell, what does each return?

Hi Oaktree,

yes the font color same and both RGB are matching
just wanted to let you know column M color i have applied Conditional formatting and for column R color was copied from PPT file


FS.xlsm
KLMNOPQR
6Unaided Brand Awareness - First Mention1%+0.210.2
7Unaided Brand Awareness - Any Mention19%+0.2190.2
8Unaided Brand Awareness - Other Mentions18%+0.1180.1
9Aided Awareness96%-0.996-0.9
10Total Ad Awareness33%+13.43313.4
11Online Ad Awareness20%+8.1208.1
12CTV Ad Awareness 8%+3.483.4
13Message Association - "We Got Now"9%+1.191.1
14Brand Favorability57%+1.4571.4
15Consideration Intent49%+6.2496.2
16Recommendation - T3B33%+8.4338.4
17Recommendation - B3B11%+2.1112.1
18324/648
19
20n#REF!#REF!324/648
21#REF!
22
23
24
25
26
27
28
29
30BD
3124
32
33929
3410215
3511215
361229
3713243
3814245
3915245
4018215
4119215
4220243
4321243
4422215
Data
Cell Formulas
RangeFormula
L6:L17,L20L6=INDEX(INDIRECT("'"&$G6&$H6&"'!A"&$I6&":IV"&$J6&""),MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0),L$2)
M6:M17M6=INDEX(INDIRECT("'"&$G6&$H6&"'!A"&$I6&":IV"&$J6&""),MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0),M$2)*100
M20M20=INDEX(INDIRECT("'"&$G20&$H20&"'!A"&$I20&":IV"&$J20&""),MATCH($K20,INDIRECT("'"&$G20&$H20&"'!A"&$I20&":A"&$J20&""),0),M$2-1)
Q20Q20=Q18
L21L21=L20&"/"&M20
L30:M30L30=CHAR(L31+64)
L31:M31L31=L2
K33:K44K33=MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0)
L33:M44L33=Getfillcolor(INDIRECT("'"&$G6&$H6&"'!"&L$30&$K33&""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K33:K67Cell ValueduplicatestextNO
M6:M19Expression=M33=$W$1textNO
M6:M19Expression=M33=$W$2textNO
M6:M19Expression=M33=$W$3textNO
 
Upvote 0
I’m guessing your GetFillColor UDF isn’t designed to return fill colors applied by conditional formatting and that the test from my previous post would return different values.

See Conditional Formatting Colors for a different UDF you could use to return the conditional format fill color for column L, which you could then compare against GetFillColor for column R.
 
Upvote 0
I’m guessing your GetFillColor UDF isn’t designed to return fill colors applied by conditional formatting and that the test from my previous post would return different values.

See Conditional Formatting Colors for a different UDF you could use to return the conditional format fill color for column L, which you could then compare against GetFillColor for column R.
Okay! Thanks for your time on thsi.Can you please help me out with this if possible 😊
 
Upvote 0
Okay! Thanks for your time on thsi.Can you please help me out with this if possible 😊

Hi,

I have checked with all the VBA and didn't get cell color where i have a color with Cf. and getting same score.

Cell Formulas
RangeFormula
N5:P5N5=FORMULATEXT(N6)
N6:N19N6=ActiveCondition(M6)
O6:O19O6=GetStrippedValue(M6)
P6:P19P6=ColorOfCF(M6,FALSE)
M6:M17M6=INDEX(INDIRECT("'"&$G6&$H6&"'!A"&$I6&":IV"&$J6&""),MATCH($K6,INDIRECT("'"&$G6&$H6&"'!A"&$I6&":A"&$J6&""),0),M$2)*100
Cells with Conditional Formatting
CellConditionCell FormatStop If True
O5Cell Valuecontains "Delta"textNO
L4:N5,Y4:AD5,P4:T5Cell Valuecontains "Delta"textNO
M6:M19Expression=M33=$AA$1textNO
M6:M19Expression=M33=$AA$2textNO
M6:M19Expression=M33=$AA$3textNO
 
Upvote 0
Hi there,

You can't obtain the fill color from CF cells with a UDF.
You can however, color the cells with the same color given by the CF with a Sub, that way, your UDF will work.

Select the range with the CF colors and run the macro.

Here is the code:
VBA Code:
Sub FillCellWithCFColor()
Dim myRange As Range
Set myRange = Selection

Dim cell As Range
For Each cell In myRange
    cell.Interior.Color = cell.DisplayFormat.Interior.Color
Next cell

End Sub

You can delete CF after that, the colors will remain, this time, not conditional.
 
Last edited:
Upvote 0
Leo:
You can't obtain the fill color from CF cells with a UDF
this actually *is* possible! See the method on Chip Pearson's webpage per the link in my previous post

One (maybe two) things will fix this for you:

1) Per the note at the top of Chip's page:

NOTE: ActiveCondition may result in an inaccurate result if the following are true:

  • You are calling ActiveCondtion from a worksheet cell, AND
  • The cell passed to ActiveCondtion uses a "Formula Is" rather than
    "Cell Value Is" condition, AND
  • The formula used in the condition formula contains relative addresses

As such, instead of having the conditional formatting rule be "Use a formula to determine which cells to format", use "Format only cells that contain". You can still link the values to AA1, AA2, and AA3 respectively, but this will circumvent the issue Chip explained, as I think your use case hits on all three of those.

2) Note that, if your GetFillColor returns the interior.colorindex (and not the interior.color), you'd use ColorIndexofCF instead of ColorofCF
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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