I have a set of required items spread across A1:H40 and a buylist in col. J. I was reading this, but I'm a bit overwhelmed.
How do I color the cells across A1:H40 with text that match the ones in col. J?
Is there a way to incorporate this function into a button so that it can be applied to other spreadsheets as well (or any other efficient way)?
In addition, is there a way to design a fool-proof script that eliminates the excessive spaces at the end of each cell due to typing errors?
Clear existing CF from and select A1:H40 and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=COUNTIF($J:$J,A1)
Format..., select formatting of your choice, OK, OK.
Seems to me not to require a button to make this any easier, and 'spaces' is a completely different Q that should not be combined with another.
Related
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.
I have several spreadsheets where I want to highlight all the rows where the data matches a separate list. I have used a rule for this but it's not highlighting it exactly; it's just matching part of the word, for example General manager in one list is highlighting Manager in the other list whereas I would only want it to highlight General manager.
This is the formula I've used:
=COUNTIF(A92:A400,L2:L196)
and I've also tried MATCH but it pulled out out even more incorrect matches.
You will have to bring in the EXACT function somewhere.
This CF rule was created by selecting A1:D7 and creating a rule based upon the following formula,
=AGGREGATE(15, 6, ROW(1:1)/EXACT($A1, $F$8:$F$10), 1)
The way I interpret the question is that case sensitivity may not be required, rather that use of wildcards may be causing issues (ie that exact text match is not applying "exact" in quite the same way the EXACT function does). If the separate list is the one in ColumnL then please select from A92 to A400 and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=COUNTIF(L$2:L$196,A92)
Format..., select your choice of highlighting, OK, OK.
If to be applied to several sheets it may be convenient to Name the L2:L196 range.
The above highlights cells rather than rows, but that could be adjusted.
I have the following conditional formats, and I am wondering if it is possible to join them together in one, so I don't need to add them all separately:
IF($A11&$D11=$W$14;AND($K11>$X$14;$K11<$Y$14))
IF($A11&$D11=$W$15;AND($K11>$X$15;$K11<$Y$15))
IF($A11&$D11=$W$16;AND($K11>$X$16;$K11<$Y$16))
IF($A11&$D11=$W$17;AND($K11>$X$17;$K11<$Y$17))
IF($A11&$D11=$W$18;AND($K11>$X$18;$K11<$Y$18))
IF($A11&$D11=$W$19;AND($K11>$X$19;$K11<$Y$19))
IF($A11&$D11=$W$20;AND($K11>$X$20;$K11<$Y$20))
IF($A11&$D11=$W$21;AND($K11>$X$21;$K11<$Y$21))
IF($A11&$D11=$W$22;AND($K11>$X$22;$K11<$Y$22))
IF($A11&$D11=$W$23;AND($K11>$X$23;$K11<$Y$23))
IF($A11&$D11=$W$24;AND($K11>$X$24;$K11<$Y$24))
IF($A11&$D11=$W$25;AND($K11>$X$25;$K11<$Y$25))
IF($A11&$D11=$W$26;AND($K11>$X$26;$K11<$Y$26))
IF($A11&$D11=$W$27;AND($K11>$X$27;$K11<$Y$27))
IF($A11&$D11=$W$28;AND($K11>$X$28;$K11<$Y$28))
IF($A11&$D11=$W$29;AND($K11>$X$29;$K11<$Y$29))
IF($A11&$D11=$W$30;AND($K11>$X$30;$K11<$Y$30))
IF($A11&$D11=$W$31;AND($K11>$X$31;$K11<$Y$31))
IF($A11&$D11=$W$32;AND($K11>$X$32;$K11<$Y$32))
IF($A11&$D11=$W$33;AND($K11>$X$33;$K11<$Y$33))
Green fill to be applied to $K$11:$K$344 within a Table:
If this can be done easily in VBA, that could do as well.
Please select K11:K344 and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(K11>=VLOOKUP(A11&D11,W$14:Y$344,2,0),K11<=VLOOKUP(A11&D11,W$14:Y$344,3,0))
Format..., select green, OK, OK.
You can maybe use COUNTIFS:
=COUNTIFS($U$11:$U$33,A11,$V$11:$V$33,D11,$X$11:$X$33,"<"&K11,$Y$11:$Y$33,">"&K11)
The above does not need the concatenated Region and Site Type (thus more criteria can be added as needed), but if you already have it, you can shorten it a little bit:
=COUNTIFS($W$11:$W$33,A11&D11,$X$11:$X$33,"<"&K11,$Y$11:$Y$33,">"&K11)
The set up of the conditional formatting remains the same.
COUNTIFS will return a number above 0 (interpreted as true) if there any matches to the Region, Site Type, lower and upper bounds, otherwise will return 0.
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.
I have a sheet with several columns. Column A consists of numbers. Depending if the cell value in column A is even (or odd) I want to highlight several cells in that row, but not the entire row.
So far using conditionally formatting I have been able to add a formatting rule for each column I want to have highlighted. So for example if I want columns A, B and E highlighted I use three rules:
Formula: =ISEVEN(A1) - Highlight Format - Sheet!$A$1:$A100
Formula: =ISEVEN(A1) - Highlight Format - Sheet!$B$1:$B100
Formula: =ISEVEN(A1) - Highlight Format - Sheet!$E$1:$E100
...and etc for all additional columns.
But this is very cumbersome, I don't know how to make a rule to cover it all in once or even if it is possible. I'm guessing VBA might be the solution, but I'm kinda a rookie there.
Any clues on how to attack this?
You should just fix your reference column in the formula for that (A becomes $A in this case). The ranges it applies for then can be all put in the same rule as well:
Formula: =ISEVEN($A1) - Highlight Format - Sheet!$A$1:$B100;Sheet!$E$1:$E100
So no VBA required!
:) You do not need to sweat so much at all. I am not sure what your Highlight Format for. You can add the even, odd into the conditional formatting window/wizard text boxes and then choose the formatting colour accordingly.
Try this out:
For even:
=MOD(A1,2)=0
For odd:
=MOD(A1,2)>0
Check the following article for better help on Excel conditional formatting
Another article for 10 cools way to use Excel conditional formatting