I would like to conditional format the "N - I - P" cells based on the cell data in Column A. Each row might have a different value in Column A. Is there a quicker way to conditional format?
Link to Spreadsheet with Example.
Use Custom Formula.
Rule:
Formula:
=IF(AND(A1=E1,NOT(ISBLANK(E1))),1,0)
or
=AND(A1=E1,NOT(ISBLANK(E1)))
Just change E to D and C for other columns. Do not forget to also update the Apply to range per color.
Output:
Related
[inventory sheet] (https://docs.google.com/spreadsheets/d/1kLDo8Up_RJa2rXsEZ9ElKBEhGUTsMw61-fQspOPuBz4/edit#gid=0)
I'm trying to conditionally format column E based on column D. For example, if the value in column D is <8, highlight the adjacent cell in column E green. If value is >7 and <15, highlight yellow. If value is >14, highlight red.
The formula I have now works, but I can't figure how to apply the formatting to the entire column without manually inputting 3+ conditional format rules on each individual cell.
The existing conditional format from your sheet is partially correct, it just needs some tweaking on the Apply to range value. You can create 3 conditional formats on E3 and it will apply to the whole column of E if you put the E3:E on range.
Please see the 3 conditional formats I have created based from your given sheet.
Conditional format 1:
Conditional format 2:
Conditional format 3:
Output:
Reference:
AND function
Just select the whole range and create one single rule per condition. Use the formula as it is created for the first cell and it will "drag" automatically.
For example with =D2>15
So have an ArrarFormula in H5 that works exactly the way I want. It searched all the cells in column C and compares them to column A and returns TRUE when column C contains column A. The problem is that I want to move that formula to conditional formating. When I do that it only captures some of the cells, highlighted in Blue. Here is the formula.
=ARRAYFORMULA(IFNA( LEN(REGEXEXTRACT(C5:C, JOIN("|",QUERY(A5:A, "Select A where not A is null")))) > 0))
I have tried copy/pasting to conditional formatting and removing the ArrayFormula and the IFNA. I still get the same results. I know that I can just reference column H in conditional formatting, but I want to try to keep this as clean as possible.
Here is a link to the sheet. https://docs.google.com/spreadsheets/d/1xT_U_UZ27X724VAGwUjZ_6fHkE6IaegnbzQTC_kOfEg/edit?usp=sharing
I just modified your original formula so it can work with conditional formatting:
=IFNA( LEN(REGEXEXTRACT(C5, JOIN("|",QUERY($A$5:$A, "Select A where not A is null")))) > 0)
Remove array formula and just use C5, the conditional formatting will automatically adjust its row based on your selected Apply to range
You need to fix the range in your query() by locking its row and column using $
Output:
I am using below formula that is working fine on same sheet to highlight the row where found "Terminated".
=$E3="Terminate"
I want to highlight the same row on other sheets as well where found "Terminate" on "Leave Data" sheet range E3.
Each sheet has same Employees name on Col B. May that would made it easy to highlight the same row on other sheets
Can someone please share a solution to this question.
Conditional formatting does not support direct sheet references, but you can "trick" it by using INDIRECT and CELL:
So in cell A1 of Sheet3, create a conditional formatting rule valid for the whole range A1:A100 and insert this formula:
=INDIRECT("Sheet2!"&CELL("address", E1))="Terminate"
INDIRECT
CELL
Explanation
Between INDIRECT and CELL, it creates an "indirect" reference to the value of the target cell which conditional formatting can understand.
You can also make it fill the whole row by adding a $ to the E as in this formula:
=INDIRECT("Sheet2!"&CELL("address", $E1))="Terminate"
I'm trying to get a cell to highlight with a certain color if the text of two other cells match. Has anyone else done this?
Example:
If the value in the cell A2 is "Car" and the value "Car" is in a range on another sheet, can the cell B2 be filled with a color?
Assuming a range on another sheet is ColumnC of Sheet2, then select B2, apply the Conditional Formatting custom formula:
=match(A2,indirect("Sheet2!C:C"),0)
and certain colour fill.
This can be achieved using conditional formatting.
Select the cell (B2 in your example) and in the menu bar go to Format > Conditional Formatting...
Here you want to use a custom formula. Specifically for your example, the formula to input would be:
=AND(A2="Car",COUNTIF(C2:C5,"Car")>0)
Note that the range that is being checked for "Car" is C2:C5, since you didn't specify any for your example.
EDIT:
Following the discussion in the comments:
=COUNTIF(Sheet2!$C:$C,A2)>0
What this does, is that it looks for the value in A2 in column C in Sheet2 and if it occurs once or more, the cell that you have applied this conditional formatting to, will be coloured.
I'm trying to have a cell on Sheet A check if it's either > or < the value in a cell on Sheet B, then change its color accordingly. Under the custom formula I use: =A1>("SheetB!A1"), but it doesn't seem to work. I use the color Green for the > and the color Red for the <. Every time the rules are saved it will always display A1 on Sheet A in red.
Is the function wrong? Or is it not possible to have a Conditional Format even search across sheets?
For some reason (I confess I don't really know why) a custom formula in conditional formatting does not directly support cross-sheet references.
But cross-sheet references are supported INDIRECT-ly:
=A1>INDIRECT("SheetB!A1")
or if you want to compare A1:B10 on SheetA with A1:B10 on SheetB, then use:
=A1>INDIRECT("SheetB!A1:B10")
=A1>INDIRECT("SheetB!"&CELL("address",A1))
applied to range A1:B10.
You can do this by referencing the cell and row number in the current sheet, so as you drag-copy that conditional formatting to other rows it will reference the correct cells.
In the below equation I am coloring cells based on the exact same cell in some other sheet named "otherSheetName" in this example. If for example you want to color cell B2 in Sheet2 if the cell B2 in otherSheetName contains the text "I Like Dogs" you would go to cell Sheet2!B2 , click condition formatting, choose equation from the drop down and paste the below equation.
=IF(INDIRECT("otherSheetName!"&ADDRESS(ROW();COLUMN()))="I Like Dogs";1;0)
Comparing strings instead of numbers for a conditional formatting rule, you can use:
=EXACT(A1,(INDIRECT("Sheet2!A1")))
Case sensitive.
There is one trick/bug: if you have conditional formatting in Sheet1 that explicitly references itself (e.g., the formula is Sheet1!$C$2), you can copy the conditional formatting to Sheet2 with Paste special > conditional formatting and it will "work"... as long as you don't touch anything:
if you try to edit the conditional formatting in Sheet2, then you'll get an "Invalid formula" error.
if columns/rows change in Sheet1 such that they affect the conditional formatting (e.g., row/column inserts), this is not reflected in Sheet2 (keep in mind that the indirect trick mentioned by #AdamL will also not reflect column/row updates either, so it's a wash in this respect).
I was able to compare two sheet and highlight the differences on the second sheet using conditional formatting :
=A1<>(INDIRECT("Sheet1!"&Address(Row(),Column(),)))