Conditional Formatting Not Working

VinceF

Board Regular
Joined
Sep 22, 2007
Messages
172
Office Version
  1. 2016
Platform
  1. Windows
Another one for the experts. I'm trying to apply conditional formatting using the format painter but for whatever reason it doesn't seem to be Appling the condition as it should.
I have 9 columns Z5 thru AH5 and 39 rows J12 thru J51
The formula that I'm using is =AND($B$7="Half","Half Stroke Skins"!,$Z5=1)) when I drag this across with FP it doesn't hold the formatting correctly. I then manually corrected each cell in the row 5 to this...=AND($B$7="Half","Half Stoke Skins"!,Z$5=1)) and tried dragging it down, same problem.

I hope that I've explained this adequately and thank you for your assistance.

VinceF
Win 10
Office 2016
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
which range are you formatting - when you select a range to format - that is the start of the formula
so if you start at Z2 in the selection , then you need to start the formula at Z2 to test that cell
OR
you can use FIXED address with the $
so
$B$7
Will always look at that cell nomatter where you are or where you drag

$Z5=1
Will always look at column Z as that has the $
BUT as you drag down the rows, that will change - so Z6,Z7 etc

however
Z$5=1
Fixes the row
So will always look in Row 1
and as you drag
Z5, AA5,AB5,AC5, across or down

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
 
Upvote 0
which range are you formatting - when you select a range to format - that is the start of the formula
so if you start at Z2 in the selection , then you need to start the formula at Z2 to test that cell
OR
you can use FIXED address with the $
so
$B$7
Will always look at that cell nomatter where you are or where you drag

$Z5=1
Will always look at column Z as that has the $
BUT as you drag down the rows, that will change - so Z6,Z7 etc

however
Z$5=1
Fixes the row
So will always look in Row 1
and as you drag
Z5, AA5,AB5,AC5, across or down

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Etaf,

Firstly, thank you for your reply.

You'll see on the Main page J12 is highlighted in Red. The CF is looking at a helper sheet called "Half Stroke Skins". The CF in J12 I believe is set up correctly to drag the format painter from left to right which is looking at cell Z5 thru AH5 on the helper sheet. Once that is done, I'd fix each cell to be dragged down by the FP by moving the $ appropriately. I've tried this many times and as I indicated the FP isn't referencing the cells as it should be. My only alternative is to do each cell manually...but that'd take a month of Sunday's.

MASTER TEMPLET skins-stableford sheet 2-27-22.xlsm
IJKLMNOPQRSTUVWXYZAAABACADAE
11SKINSFRONTINBACKOUTTOTALSPOINTS
12Yes34444444435455555555447928
13Yes53444444436535555555437928
14Yes54344444436554555555448027
15Yes54535555542555455555448621
16Yes55543555542555545555448621
17Yes55555355543555554555448720
18Yes55555435542555555455448621
19Yes55555553543555555545448720
20Yes55555555343555555553438621
21    
22    
23    
24    
25    
26    
27    
28    
29    
30    
31    
32    
33    
34    
35    
36    
37    
38    
39    
40    
41    
42    
43    
44    
45    
46    
47    
48    
49    
50    
51   
Main
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J12Expression=AND($B$7="Half",'Half Stroke Skins'!Z$5=1)textNO
J12Expression=AND($B$7="Full",' Full Stroke Skins'!Z$5=1)textNO
I11Expression=($B$4="skins")textNO
I11Expression=($B$4="stableford")textNO
I11Expression=ISTEXT($I$12:$I$51)textNO
I11Expression=ISNUMBER($D$12:$D$51)textNO
I11Expression=$B$4="Stableford"textYES
 
Upvote 0
so J12 is
=AND($B$7="Half",'Half Stroke Skins'!Z$5=1)
and will highlight = IF $B$7="HALF" and the helper sheet Z5 =1
OR as you have a second formula for RED fill
=AND($B$7="Full",' Full Stroke Skins'!Z$5=1)
Then B7 =full
therefore
IF Z5 on helper =1 , and B7 is either FULL or HALF - it will be red

lets move now to K13 cell
Because the formula has B7 with $ that will not change
so B7 is either FULL or HALF - it will be red

BUT Z5 is fixed with a $5
so the ROW cannot change
as we have moved down a row to K13 - it still checks row 5 on your helper column
BUT the column can move - so now its checking AA
so the formulas effectively being used in that K13 cell to turn the fill RED is
=AND($B$7="Full",' Full Stroke Skins'!AA$5=1)
=AND($B$7="HALF",' Full Stroke Skins'!AA$5=1)

perhaps also post the helper sheet using xl2bb






 
Upvote 0
Upvote 0
ONLY Z5 =1 , so thats the only cell that will highlight, on the main sheet is J12
IF you change some of the row 5 cells to a 1 - then the other sheet cells should also highlight red

J = Z on helper
K = AA on helper

for example changing cell AF5 to a 1
then P12 on the main sheet should fill RED
 
Upvote 0
I had cleared out the CF's from all of the cells except for J12...I'll fill them in using the Format painter so that you can see what it is or what it is not doing....give me a few.
 
Upvote 0
I had cleared out the CF's from all of the cells except for J12...I'll fill them in using the Format painter so that you can see what it is or what it is not doing....give me a few.
Ok...I ran J12 across using the FB, then ran the rows down using the FP, this is what I got.

MASTER TEMPLET skins-stableford sheet 2-27-22.xlsm
JKLMNOPQR
12344444444
13534444444
14543444444
15545355555
16555435555
17555553555
18555554355
19555555535
20555555553
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Main
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K13:R51Expression=AND($B$7="half",'Half Stroke Skins'!$AA6=1)textNO
K13:R51Expression=AND($B$7="full",' Full Stroke Skins'!$AA6=1)textNO
J13:J51Expression=AND($B$7="half",'Half Stroke Skins'!Z$5=1)textNO
J13:J51Expression=AND($B$7="full",' Full Stroke Skins'!Z$5=1)textNO
K12:R12Expression=AND($B$7="half",'Half Stroke Skins'!$AA5=1)textNO
K12:R12Expression=AND($B$7="full",' Full Stroke Skins'!$AA5=1)textNO
J12Expression=AND($B$7="half",'Half Stroke Skins'!Z$5=1)textNO
J12Expression=AND($B$7="full",' Full Stroke Skins'!Z$5=1)textNO
 
Upvote 0
it will highlight down the column with the format painter

As the formula
=AND($B$7="Half",'Half Stroke Skins'!Z$5=1)
is not changing in any of those cells

but you have loads of different formulas now with format painter
applying to different ranges

Why use the format painter brush - any particular reason - then just select all the cells you want to apply the conditional formatting to
and then add the formula(s)

then you will just get the one formula appling across the whole sheet - instead of lots of formulas for different ranges to do the same formula

Book5
JKLMNOPQRS
1SKINSFRONT
2Yes344444444
3Yes534444444
4Yes543444444
5Yes545355555
6Yes555435555
7Yes555553555
8Yes555554355
9Yes555555535
10Yes555555553
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K2:AC10Expression=AND($B$7="Full",'Half Stroke Skins'!AA$5=1)textNO
 
Upvote 0
ok thank you let me play with it a bit and I'll let you know...very much appreciate the assistance.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,850
Members
449,051
Latest member
excelquestion515

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