Excel conditional formatting using generic formula - excel

I want to conditionally format cells in Excel. Is it possible to create a generic formula that does the following:
IF the value in column A of the given row = "A"
AND the value in the given cell is greater than .1
AND the value in the given cell is less than 1
THEN format the cell with a light grey background color
In the example below, I want the formula to apply to cells B1:K2, but I only want cells E1, I1 and K1 to be highlighted in grey.

Select B1:K[n]. B1 is the active cell.
Then, click Home > Conditional Formatting > New Rule.
In the New Formatting Rule dialog box, click Use a formula to
determine which cells to format.
Under Format values where this formula is true, type the formula:
=AND($A1="A",B1>0.1,B1<1)
Click Format.
In the Fill box, select your light gray color.
Click OK until the dialog boxes are closed.
Greetings
Axel

Tap F5 and when the GoTo dialog opens, type A:K (◄ just like that) into the Reference: box and click OK. You should have columns A through K selected with A1 as the Active Cell.
Create a new Conditional Formatting Rule using the Use a formula to determine which cells to format option and supply the following for Format values where this formula is true:
=AND($A1="A", A1>0.1, A1<1, ISODD(COLUMN(A:A)))
Click Format and select a light=grey Fill then click OK to accept the format and then OK again to create the new CF rule. Your results should resemble the following.
    
Edit: Revised from literal interpretation to subjective interpretation

Select cells E1:F2,I1:I2,K1:K2 (hold down Ctrl while selecting discontinuous range) so the conditional formatting will apply to them.
The cell K1 should have the focus, i.e. be highlighted with white background, while other selected cells are highlighted with dark background. Insert conditional formatting with following formula:
=($A1="A")*(K1>0.1)*(K1<1)

Related

Color a few cells according to 1 cell's value

I have a hourly plan where time of employees' meetings automatically appears from an other sheet.
I need it to be marked with specific color according to meeting's lenght.
Ex.
"A1=0,5 then A1 is blue
if A1=1 then A1 and A2 is blue
if A1=1,5 then A1, A2, A3 is blue and etc."
I only find info how to mark specific cell using conditional formating or VBA, but don't know how to apply formula to the whole table
Conditional Formatting
Select the range where you want this applied, e.g. A1:A10, or A1:J10 if you want this to work in the other columns, too.
On the Home tab select Conditional Formatting > New Rule.
In the New Formatting window select Use formula to determine which cells to format.
In the text box below enter this formula:
=A$1/0.5>=ROW()
Press the Format button below and in the Format Cells window select the Fill tab. Select a color and press Ok 3 times.

How to make cell format change depending on checkbox value in Excel

Here is what I am trying to achieve in Excel. My objective is to have a list of taks on the left and a list of tests in all the others columns.
What I would like to achieve is that when I check a checkbox for a task (for example task "a", all other cells containing the letter "a" get colored in green), like shown below:
Similarly, when I click on task b, all cells containing "b" get colored in green.
Then, if all steps of a test are in green, the text turns green and increase the number of tests that can be tested, like shown below.
The thing that I have tried yet is to do some conditionnal formatting but I cant find a generic formula that says (if my cell has the value of a cell that is checked). Help would greatly be appreciated!
Follow these steps
Right Click on checkbox of each cell, Start from B3 Checkbox. Click on Format Control at the end of option window. In the Cell Link Type the Same Cell Name of Checkbox, e.g B3
(for Each checkbox, you have to put its Cell link manually)
Select Whole Column B and then select the font color White. So the text TRUE or FALSE of selected or unselected checkbox will not overviewed.
Copy this formula in D2
=IFERROR(IF(INDEX(B:B,MATCH(E2,A:A,0))=TRUE,E2,""),"")
Drag it down
Select Column E, Go to conditional Formatting > New Rule > Use a formula to determine which cells to format
Use this formula in there
=AND(D2=E2,E2<>"")
Then Select Column G and select its font color White
in G2 Use this Formula
=IF(F2="","",IF(COUNTIF($F$2:$F$20,F2)=COUNTIF($D$2:$D$20,F2),F2,""))
Select Column F, Go to conditional Formatting > New Rule > Use a formula to determine which cells to format
Use this formula in there
=AND(G2=F2,F2<>"")
Select Column A, Go to same conditional formatting as above and use
=B3=TRUE
You are done

Conditional Formatting for rows

How do you drag the conditional formatting across the row? For example I have color red for not equal to and green for equal to, but how can you apply the conditional formatting across the row "Due" for the other dates?
enter image description here
Your conditional formatting rules seem to be wrong.
That should do it:
Erase your current "Conditional formatting" rules.
Select the desired cells in row 10, starting from F10.
Click Conditional formatting / New rule / Formula.
Enter =F$10=F$11, click "format" and choose green fill color. Confirm with "OK" twice.
Repeat step 2 and 3.
Enter =F$10<>F$11, click "format" and choose red fill color. Confirm with "OK" twice.
Note:
The formula is always based on the active cell (the one you choose first in your selection, here F10).
Conditional Formatting > Manage Rules, select your relevant rule and edit the 'Applies to' range field to include the cells you want it to apply to.

Formatting cell based on adjacent cell value

I would like a cell to be color filled or formatted based on the value in the adjacent cell. For example, if cell D1= #NA then I want the font in C1 to be filled in red.I would like to compare entire range in column C and D for this. Is there any conditional formatting rules or VBA macro that can accomplish this?
To apply such a format to C3 based on the contents of D3:
Select C3
In Conditional Formatting click New Rule...
Select "Use a
formula to determine which cells to format"
For the formula enter
"=ISNA($D$3)"
Click the Format button to set up the format that gets
applied when the previous formula returns TRUE
Hope that helps
Very simply select the range you want in column C and just make a conditional format using an equation and use
=$D1=""
and change the format text color to what ever you want.
Conditional formatting would be easiest way to do this.
If under conditional formatting you select new rule and then "use a formula to determine which cells to format". A formula such as =$D$1="#na" and change the format to what you would like. If you click OK and make sure this applies to C1 and stop if true is selected.
This worked for me! If you would like to use vba then let me know.
Conditional Formatting can do this. Pick the "Use a formula to determine which cells to format", enter
=7=ERROR.TYPE(D1)
Set the red fill. Now copy & apply to entire column.

How can I color a cell based on character capitalization?

I have a list of text values I want to show as a drop down menu, which is mentioned below.
If the value contains capital letters, I want the cell to be colored blue. On uncapitalized letters, I want to use a yellow shading.
I have tried many things, but was unable to get what I want. Can I use conditional formatting to recognize the difference between small and capital letters?
{d;D;EZ;F;f;g;G;s;S;SU;U;u}
For the purpose of this example, I have assumed your dropdown list to be located in cell A1. Make sure to edit the formulas to fit your needs.
Go to conditional formatting and create three rules:
Select Use a formula to determine which cells to format, enter=EXACT(A1,UPPER(A1)) and format the cell with blue fill color.
Select Use a formula to determine which cells to format, enter=EXACT(A1,LOWER(A1)) and format the cell with yellow fill color.
Select Format only cells that contain. Under "Format only cells with:" select Blanks. There will be no need to change the formatting.
Hope this helps!
1. Create the drop down list
Select the cell where the drop down menu should be placed.
On the Data ribbon tab click 'Data Validation'.
Select Allow: List
Enter your text values at Source: without the curly brackets. The separator can differ from your localization. Standard english computers are using the comma as the separator. On my German machine, I have to use a semicolon.
Click OK. Your cell now has a fancy drop down button on the right.
2. Conditional formatting
Select the cell containing the drop down list
On the Home tab, click Conditional Formatting -> New Rule
Select 'Use a formula to determine which cells to format'
At 'Format values where this formula is true:' enter this formula:
=CODE(A1)<=90
Click format and select a blue cell shading.
Repeat the last steps to enter the formula for the yellow shading:
=CODE(A1)>=97
Click format and select a yellow cell shading.
Pay attention that you have to change A1 to the actual location of your drop down cell.

Resources