GoogleSheet Conditional Formatting - google-sheets

I'm trying to compare the values between two cells in different columns to locate errors quickly. I want the color in one cell to change if the value is not the same as the adjacent cell.

use a custom formula in conditional formatting like =A1=B1 let's say on range A1:B
or some more complexity:
=($B1=$C1)*($C1<>"")*($B1<>"")

Related

Conditional formatting of cells in a range of columns matching values in a list

I have a range which spans the columns A to AV and I need to highlight all cells in that range that contain text from a list of elements placed at AY20:AY27.
I know how to highlight matches between two lists. However, I cannot find a working solution applicable for a whole range.
I have also tried to use the "Contains text" option which works if I take each element of the list individually to create a conditional formatting rule. The problem with that method is that if one of the elements of the list is empty then all the range will be highlighted. And the list is manually typed and won't always fill AY20:AY27.
Is there any way to make this conditional formatting work in any way?
Thanks!
Please try clearing formatting from and selecting ColumnsA:AV and Format, Conditional formatting..., Format cells if... Custom formula is and:
=countif($AY$20:$AY$27,A1)
Then select formatting of choice and Done.

How to conditionally format highest value of multiple ranges

I'm trying to use conditional formatting to highlight the maximum value over multiple ranges. That is, find the one highest value in said ranges and highlight all instances of it. I have been able to use conditional formatting to highlight the highest number of one column, but not over multiple.
The ranges in question are: G3:G13,J3:J13,M3:M13,P3:P13,S3:S13,V3:V13
Screenshot of the spreadsheet
The versions I have tried either highlight every value in the first row, multiple values but not the highest one, or nothing at all.
An alternative is to use a MAX function and place that value in another cell (the little 4 in the bottom right corner) and use conditional formatting based on that value. However, it's not a particularly elegant solution nor have I been able to make that work properly.
I am using New Google Sheets and am familiar with custom formatting and custom formulas for doing so.
You need to use Conditional Formatting Custom Formula.
Set Apply to Range
G3:G13,J3:J13,M3:M13,P3:P13,S3:S13,V3:V13
Enter in Custom Formula is
=G3=(max($G$3:$G$13,$J$3:$J$13,$M$3:$M$13,$P$3:$P$13,$S$3:$S$13,$V$3:$V$13))
Pick your formatting style.
You may have to scroll down the Format cells if menu to find Custom Formula.

Google Sheets Conditional Formatting based on two cells

I have a sheet where I would like to turn a row a color based on the value of two cells. I already have conditional formatting based on one cell of the cells I want to use for the two cell formatting.
I am using =AND($J:$J="Cancel",$L:$L="Yes") for the two cell formatting but it doesnt seem to work. Not sure if the first one =$J:$J="Cancel" is negating the formatting of the other or if if my formula is just bad.
Any advice would be appreciated.
if the trick is that you want the whole row to be colored that way, then all you need to modify is the "range" to apply it too, so you enter something like the start column and then just give it a row number as the second half of the range, without the column argument: A1:10001
That exact formula you listed =AND($J:$J="Cancel",$L:$L="Yes") worked for me when using the "custom formula" option:

Apply conditional formatting to a range of cells if a specific cell is not empty

I'm trying to apply conditional formatting to a range of cells.
If cell 'C5' as per picture is not empty then apply colour yellow to cells C6:C12.
What I have tried changes the colour of only one cell i.e. just C6.
Please try selecting C6:C12, Format, Conditional formatting..., Format cells if..., Custom formula is:
=C$5<>""
and chose yellow, Done.
To achive that, you should select the Cells you want the conditional formatting to apply to, and then set the Formatting to "Custom formular", which should be
=$C$5<>""
The $ means, that neither the Column nor Row should advance with the target area.
So
=$G1<>""
would mean, that if your Target Area was A1:F4 (the first four cells of the first six columns), that the formatting would depend on G1 for A1:F1, on G2 for A2:F2 and so on (the Row is advancing in this example, while the column is still fixed as being G.)
You need both $ - i.e. =$C$5<>""
Just tested and works here.

Conditional Formatting from another sheet

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(),)))

Resources