Conditional formatting multiple rules to single cell - excel

I have used one formula to change the font colour if a cell contains the text "complete" & another formula to add a light blue fill to the entire row if the word "odd" appears in a cell which is in a different column to the first formula.
The conditions seem to clash & although I have changed and played with the order of the conditions & checked there is no conflict in the fill/background or the font colour, even when changing the font colour manually again the fill from the second formula returns the font the cell to black although it is set to automatic in the conditional formatting rule with the fill ?
I wonder where i am going wrong as everything suggests the two conditions should work fine together though when the fill is applied the font goes back to black when it should be green ?
Have you any suggestions ?

I found the issue, I needed to press clear on the font section of the formatting on the fill condition and then clear on the fill. Basically as a rule I press clear on anything not required in that condition and this seems to avoid the conflict and run upto 6 rules on the same cell with no problems!

You can combine multiple conditional formats overlapping cells/rows. (Excel's just a little picky that you do it just right!)
Always use New Rule as opposed to using the built-in rules.
Choose Use a formula to determine which cells to format.
For your example question, I populated the cells as shown above. Select cell B4 and set the conditional formatting as above =($B4="complete") . Note that I removed a $ (dynamic vs absolute cell reference) that was automatically filled in, so that I can fill the formatting's formula down.
Highlight entire Row 4 and set the conditional formatting as below. Again, note the modified $.
When it's working properly, copy entire Row 4, select the rows to which the formatting should be applied, and Paste Formatting.
[
Obviously the steps will vary for you depending on your data and what's in the neighboring cells whose formats you may or may not want affected by the formatting and copy/pasting.
Let me know if that works for you.

From my experience with conditional formatting, I believe that it applies a format to the entire cell rather than individually modifying fill or font colour, so formats will not combine. I had a similar situation and solved it by creating an additional rule. In your case, one that applies your desired font colour and background fill to the 'complete' cell if the same row also contains 'odd' using the AND() function.

Related

Conditional Formatting not enough

I'm trying to set conditional formatting in a specific group of cells J9:N12 with a locked cell I9 (110). In Cells J9:N12 I need the conditional formatting to set 1,2,7,8,13,14 as Black Fill w/ White Text, 3,4,9,10,15,16 as Red Fill w/ Black Text, 5,6,11,12,17,18 as Blue Fill w/ White Text. Then if I Change (I9) to 277 the Fills would change to reflect Brown/Orange/Yellow in place of the Black/Red/Blue.
Yes, I can Conditional Format the cells I need based on the information set in cell (I9) 110 or 277.
The series of numbers I need to format is greater than 120. I cannot set Conditional Formatting for each specific number needed. Minimallistically I need to be able to set Conditional Formatting to around 150-160 numbers.
I don't know if I need to utilize VBA or if Conditional Formatting is the way to go.
You could use conditional formatting for this. I'd be tempted to put the number series in an array and test for a find in the array using MATCH. This way, you'd only need as many conditional formatting rules as there are number series.
I'm not certain, but I believe you can't write an array directly into a conditional format rule, but you could refer to it from something like a range name. In any event, a range name would be easier to manage if you needed to change any of the number series.
For example, in the black/brown case, you could create a range name (Formulas->Define Name), called black-brown, and in the Refers To window, have the formula:
={1,2,7,8,13,14}
Then your conditional formatting rule would be something like:
=AND($I$9=110,NOT(ISNA(MATCH(B2,black_brown,0))))
Note my cell to be tested is in B2 - change that to whatever you need.
You'd just add rules for each of your number series cases, as shown below:

Is changing the color of a cell based on nested conditionals possible?

I have been trying to change the color of certain cells on my WS that fall outside of an acceptable range. The statement I've been trying to use is,
IF(OR('cell'>1.3,'cell'<2.5),'turn red','do nothing')
In english, "If a cell is less than 1.3 or greater than 2.5 turn red, else do nothing." I cannot find a resource that guides me to how I can get the cells to change colors. I also have been unsuccessful in creating a statement in the Conditional Formatting tab that satisfies my goal. I feel this should be simple, but for some reason cannot figure it out. Does anyone know if this is possible, and if so how to do it?
EDIT: Also, I have different ranges based on another cell on the spreadsheet. I need this also taken into consideration
Select the columns that you want to format
Click Conditional format --> new rule
Select "Use a formula to determine which cells to format"
In the formula bar enter the formula =AND(A1>1.3,A1<2.5)
Choose the fill color as red and press OK
am confused with your formula and your english version. If its the other way, then use the formula =OR(A1<1.3,A1>2.5)

Excel Formula If Cell Contains String

I'm currently working in excel, and I'm trying to figure out a way to find if multiple cells contain the string value of another cell, and if it does highlight the cell where the row and column meet up. I created an example of what I want, only it will be on a much larger scale.
I've tried using: =ISNUMBER(SEARCH(substring,text)) but I'm not quite sure how to use it the way I want to.
Any help will be appreciated!
Your approach is correct, we can use the fact that conditional formatting is applied like dragging a formula, adapting relative references.
Create a conditional formatting formula rule:
=ISNUMBER(SEARCH(B$1,$A2))
Applied to B2:D7
Your formula will work nicely; what you'll want to do is put that formula into all the cells you want to highlight, so you get FALSE and TRUE in every cell.
You'll then use two Conditional Formatting rules. The first will look for Cell Value = TRUE, and will set cell background and font colour to yellow. The second will look for Cell Value = FALSE, and will set cell background to No Colour and Font to White.
This will reproduce the result you're looking for.
Edited to add:
It is possible to do this using just Conditional Formatting too, but it's a little more fiddly. If you want to try it, you can do this:
Highlight your range, and take note of which cell is Active - that's the cell within your highlighted range that is still white. It's also the one whose address is shown in the Name box in the upper left. For the sake of this answer, we'll assume that's B2
Create a new Conditional Formatting rule. Choose "Use a formula to determine which cells to format".
Use the formula =ISNUMBER(SEARCH(B$1,$A2). Set the format to colour just the cell background.
Note where the $ appears in the formula above - you want to leave the row number anchored in the first part, and the column letter anchored in the second part.
This takes advantage of the fact that Conditional Formatting is able to use absolute, relative, and mixed references to find which cells to format. It's also a tidier solution, but it can be harder to maintain if the sheet is ever repurposed or modified.

Change background color of a cell if not between two values and not blank

I am trying to change the color of a cell's background to red if the cell's value is not between 0.0086 and 0.0094, and also not blank. I have successfully covered the part less than 0.0086, but the other two conditions keep giving me errors. Below is my code thus far
=(($D$2:$D$1000) < 0.0086) AND (($D$2:$D$1000) > 0.0096) AND NOT(ISBLANK(($D$2:$D$1000)))
Please try a Conditional Formatting formula rule of:
=OR(D1<0.0086,D1>0.0094,D1="")
applied to $D$1:$D$1000.
(What you want rather than what you don't want may be conceptually easier.)
Based on body of question rather than Title.
Edit to exclude blank cells from highlighting:
=AND(OR(D1<0.0086,D1>0.0094),D1<>"")
The way I got it to work is as follows:
Under Home, Styles, Conditional Formatting, Highlight Cell Rules, then Greater Than, and enter your desired value (.0094), specify that to be red fill
Under Home, Styles, Conditional Formatting, Highlight Cell Rules, then Less Than, and enter your desired value (.0086), specify that to be red fill
Under Home, Styles, Conditional Formatting, Highlight Cell Rules, then New Rule, then new rule, format cells that contain..., blanks, and specify that to be no fill (or white fill)
I believe pnuts answer would be more efficient for the computer to process, however.

Conditional Formatting on changes made in Excel

I have a Excel 2010 Sheet which contains some values.
I want to achieve the following in a specific Cell:
If the User changes the Value more than 50% make it red, more than 25% make it yellow, below make it green.
I tried achieving this with conditional formatting (3-color-scale) using a copy of that value that cannot be changed as a reference using the following formula for the red paint:
=ABS(Y10-BV10)/(BV10)>0,5
(where Y10 is the value that can be changed and BV10 contains the same value as a reference)
When trying to do this I receive the Error:
You cannot use relative references in Conditional Formatting criteria
for color scales, data bars and icon sets
Any other way to achieve this?
(I create the file myself by OpenXML and so could use fixed values in the formula instead but that seems to be a very dirty solution as this formatting should work for a few hundred cells)
Rather than using a colour bar, do the formatting manually using the formula you have used to change the colour. You'll just need to have 2 formats in order. The first saying if > 50%, the next being greater than 25%
In a new conditional formatting rule, go to Use a formula to determine which cells to format option - http://office.microsoft.com/en-gb/excel-help/use-a-formula-to-apply-conditional-formatting-HA102809768.aspx
you will need separate formula for each color though - to achieve the desired effect, make sure the rules are either mutually exclusive or else in correct order (in Manage Rules... dialog - the most general rule should be on top if you don't check "Stop if True", but if you check those checkboxes then the most specific rule should be on top)

Resources