mod(row() change font colour as required

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
159
Office Version
  1. 2021
Platform
  1. Windows
I have searched the net an Mr Excel and I have come to the conclusion that what I am trying to achieve is not possible unless I use VBA and I don't wish to do so at the moment.

My current formula in conditional formatting is:
mod(row(),4)=3 fill colour is "Tan", Text colour is "ROYAL"
If the cell has "Y" entered I would like to retain the fill colour, but have the text colour change to "GREEN" and if the cell has "N" entered text would be "RED".

Any information would be greatly appreciated, including that it is not possible with a formula if that is the case.

Cheers,
Dave.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
So then you make two more CF rules. Something like this perhaps:

=cell="Y" with formatting: fill color "tan" font color "green"
=cell="N" with formatting: fill color "tan" font color "red"

Where "cell" is the top left cell of your affected range.
 
Upvote 0
So then you make two more CF rules. Something like this perhaps:

=cell="Y" with formatting: fill color "tan" font color "green"
=cell="N" with formatting: fill color "tan" font color "red"

Where "cell" is the top left cell of your affected range.
Hi, thanks so much for the reply.
If I apply the formula as you have suggested, it also changes the lines that are currently NO FILL to tan.

I need to be able to join the mod(row() with the cells that it changes to tan.

The following did not work, but I show it here to demonstrate what I was thinking.
=AND(MOD(ROW(),4)=3,CW11=Y) "fill tan" "font green"

I would appreciate your thoughts, hoping this may explain the position better.
 
Upvote 0
When you check for text values, you need to use quotes around the value. Did you retype the formula and forget the quotes or did you not use them at all?

Excel Formula:
=AND(MOD(ROW(),4)=3,CW11="Y")
 
Upvote 0
Spelling it out in a bit more detail, the three rules might look something like this.

24 01 24.xlsm
B
2Data 1
3Data 2
4Data 3
5Data 4
6Data 5
7Y
8Y
9N
10N
11N
12
13Data 12
14Data 13
15
16Data 15
17
18Data 17
19N
20Data 19
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B20Expression=AND(MOD(ROW(),4)=3,B2="N")textNO
B2:B20Expression=AND(MOD(ROW(),4)=3,B2="Y")textNO
B2:B20Expression=MOD(ROW(),4)=3textNO
 
Upvote 0
Solution
When you check for text values, you need to use quotes around the value. Did you retype the formula and forget the quotes or did you not use them at all?

Excel Formula:
=AND(MOD(ROW(),4)=3,CW11="Y")
Thanks.
Just forgot, everything works fine.
Appreciate your help.
 
Upvote 0
Spelling it out in a bit more detail, the three rules might look something like this.

24 01 24.xlsm
B
2Data 1
3Data 2
4Data 3
5Data 4
6Data 5
7Y
8Y
9N
10N
11N
12
13Data 12
14Data 13
15
16Data 15
17
18Data 17
19N
20Data 19
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B20Expression=AND(MOD(ROW(),4)=3,B2="N")textNO
B2:B20Expression=AND(MOD(ROW(),4)=3,B2="Y")textNO
B2:B20Expression=MOD(ROW(),4)=3textNO
Hi Peter,
Thanks as always.
 
Upvote 0
Hi Peter,
Thanks as always.
You are welcome. :)

If you would like to mark a solution, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. (I have removed the 'Mark as solution' from your feedback post 6.)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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