Conditional Formating two conditions

tims31

New Member
Joined
Jul 3, 2014
Messages
38
I need some help please with conditional formatting of some cells.

I have a chart with the days of the week across the top, dates just below and then a shift pattern below that. What I currently have is two conditional comments that work, to display the column with an ‘S’ in it (ie. Weekends) to fill red and a cell with a value of ‘D’ to colour green.

What I have been trying to do but just can’t get right is to get the cells with the value ‘D’ (or N also) to format in font in the colour I want and to change the fill to red if the column has the ‘S’ value in it.

Code:
=B$5:BJ$5="S" applies to =$B$5:$BJ$11
Code:
Cell Value equal to ="D"

How do I write a formula that will colour the font and fill for the two conditions?
I will also need to do the same for ‘N’

Thank you
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
=OR(CONDITION1, CONDITION2, ...) As long as one condition is true, the conditional format will be true and the format applied.
 
Upvote 0
Code:
=B$5:BJ$5="S" applies to =$B$5:$BJ$11
Have you tried to do it in 3 separate conditions?
Select the range as you did and then
Code:
Cell Value equal to ="D"
Code:
Cell Value equal to ="S"
Code:
Cell Value equal to ="N"
 
Upvote 0
Code:
=B$5:BJ$5="S" applies to =$B$5:$BJ$11
Have you tried to do it in 3 separate conditions?
Select the range as you did and then
Code:
Cell Value equal to ="D"
Code:
Cell Value equal to ="S"
Code:
Cell Value equal to ="N"

Hi
Affraid that won't work either as the condition for 'S' is to style the column not the cell.

Basically the first condition styles the cell based on the letter it contains and the second condition styles the cells if the header of that column has an 'S' in the heading. What I need to do is style the cells based on if the cell has a certain letter in and the header has the 'S' in it which is really a combination of both the other formats.

Capture.PNG
 
Upvote 0
Hi
Affraid that won't work either as the condition for 'S' is to style the column not the cell.

Basically the first condition styles the cell based on the letter it contains and the second condition styles the cells if the header of that column has an 'S' in the heading. What I need to do is style the cells based on if the cell has a certain letter in and the header has the 'S' in it which is really a combination of both the other formats.

Capture.PNG

Is this a screenshot of what you need?
If it's not, why don't you post a screenshot of what your final result should look like...
 
Upvote 0
If the screenshot you post is the final result of you want, maybe you can try this:

ScreenShot07-06-14at0938PM_zpsa51dddc7.png
[/URL][/IMG]
 
Upvote 0
Ok, see if this makes it clearer

Below is what I want the cells to look like. The sheet just has the pattern of D and N to show day and night shifts, the S in the header row shows weekends. What I need is the conditional formating that formats the columns with an S in the header to show a red fill which it does, and if the cell contains a D to change it to green font. The problem comes when the D is in the S header column and so changes the font to green but the fill back to white. I need the formula to do if header has S fill red AND if cell contains D change font to green. I will also need to do this for N too.

Hope that makes it clearer to understand, thanks

Capture2.PNG
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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