Conditional formatting in excel sheet - excel

I want to create an excel sheet using conditional format, where user can fill either cell A1(say) or A2(say). If he fill both then both cells becomes red.

You can create a new conditional formatting rule and use the "Use a formula to determine which cells to format" option. You can use the formula:
=CountA($A$1:$A$2)=2
When we use a formula to toggle conditional formatting, the formula has to return a TRUE or FALSE which is why we check if the result of this CountA formula returns 2. If both cells A1 and A2 have any value then CountA() will return 2 and the result will be TRUE

Related

Colour a cell based on another cell being blank AND another cell being filled

I have a question concerning conditional formatting in excel:
I want to highlight one cell (lets say F1) in red but only if F6 it self is empty/blank and B1 is filled (it doesn't matter with what): How do I do it?
Use
=AND(ISBLANK(F6),NOT(ISBLANK(B1)))
or
=AND(F6="",B1<>"")
in conditional formatting.
Result:
Select cell F1
Open Conditional Formatting
Select "New rule" then "Use a formula"
Use a formula that results in TRUE or FALSE
In your case use =AND(ISBLANK(F6);NOT(ISBLANK(B1)))

How to Highlight Rows in excel based on a Formula

I'm trying to highlight all rows that have been returned True by the following formula in excel: =$G131=$G132
In the above, if the details of G131 are equal to G132, then return True and Highlight entire row.
Select the row to be formatted;
On the ribbon select Home > Conditional Formatting > New Rule;
In the new formatting rule, click Use a formula to determine which cells to format;
Under Format values where this formula is true, type the formula: =G131=G132;
Select the format color;
Click OK;

Conditionally format one cell based on values in a column

The user enters a date/time into cell B2. If this matches one of the values in column L I would like to format cell B2 as red, else format cell B2 as green.
Any idea how to do this?
Please format B2 green with standard fill, then apply the following Use a formula to determine which cells to format, Format values where this formula is true:
=match(B2,L:L,0)>0
with formatting (red) to suit and Applies to B2.
Assuming you are using Excel 2007 onwards:
Set cell shading for B2 = Green
Select Cell B2 and select the Conditional Formatting > New Rule menu item
Use a formula to determine which cells to format
In the formula bar, put in =ISNUMBER(MATCH(B2,$L$6:$L$100,0))
For format, change shading to Red
Obviously change the $L$6:$L$100 to suit you, but that should do it...
What about breaking this up into two steps.
Try putting a simple formula in Cell B1:
=ISNUMBER(MATCH(B2, L:L, 0))
This will return a TRUE if there's a match and a FALSE if there is not a match. Then make two conditional rules based on Cell B1.

Excel - programm cells to change colour based on another cell

I am trying to create a formula for Excel whereby a cell would change colour based on the text in the previous cell.
So for example if cell B2 contains the letter X and then B3 is Y, I would like B3 to turn green.
Equally, if B2 contains X and B3 contains W I would like B3 to turn red.
Any ideas much appreciated!
Select cell B3 and click the Conditional Formatting button in the ribbon and choose "New Rule".
Select "Use a formula to determine which cells to format"
Enter the formula: =IF(B2="X",IF(B3="Y", TRUE, FALSE),FALSE), and choose to fill green when this is true
Create another rule and enter the formula =IF(B2="X",IF(B3="W", TRUE, FALSE),FALSE) and choose to fill red when this is true.
More details - conditional formatting with a formula applies the format when the formula evaluates to TRUE. You can use a compound IF formula to return true or false based on the values of any cells.
Select ColumnB and as two CF formula rules apply:
Green: =AND(B1048576="X",B1="Y")
Red: =AND(B1048576="X",B1="W")
Use conditional formatting.
You can enter a condition using any cell you like and a format to apply if the formula is true.

Compare each cell from column A with each cell from column B and colum C

I've a Excel file with three columns. Cells in each columns are different ranges for example column A has 797340 cells, column B has 91617 cells and column C has 95891 cells. I need to compare each value in column A and look if this value is on column B or it's in column C and if the condition is TRUE then bold the cell or change the color to red. If there any way to achieve this using Excel formulas? Any help?
You can use conditional formating. Kindly refer to below image. Its just a demo.
Select Column A> Goto Conditional Formatting >> New Rules >> Use Formula to determine which
cells to format
Enter the formula in >> Format values where formula
is true >> select the format >> OK
=OR( IF(ISNA(VLOOKUP(A1,B:B,2,0)),FALSE,TRUE),IF(ISNA(VLOOKUP(A1,C:C,3,0)),FALSE,TRUE))
To make life easy use conditional formatting and apply your own custom rule.
http://office.microsoft.com/en-gb/excel-help/quick-start-apply-conditional-formatting-HA010370614.aspx
Unless there is a reason you need to handle this with code, you can set conditional formatting within excel based on a formula.
For example, you can create a new conditional formatting rule based on a formula such as:
=IF(ISERROR(VLOOKUP([Cell in Column A],[Column B Range],1,FALSE)),"FALSE","TRUE")
This formula will return true when a matching value is found in column B.
Then simply apply the same rule again for column C.
Apply this rule to the entire range of your column A cells, and set the conditional formatting to return bold and red when true.
Good luck!
Example with ranges in one worksheet:
Formula as applied is
=IF(ISERROR(VLOOKUP($B3,$F:$F,1,FALSE)),"FALSE","TRUE")

Resources