Changing cell colour if value modified in google sheets - google-sheets

I am working in google sheets and want the background colour of the cell to change to red if it's value has been modified. However, I want to avoid using any script for that. Is it possible to do this through conditional formatting?
If not, is there any other way to do it? (again no scripts)

this can't be done without a script because there is no way how to track down a "modified value". conditional formatting can be done based on something eg "something" stands for a fixed point in a timeline from which can change be anchored like today's date, max from range, equal to a value, etc.

Possible with Conditional Formatting provided there is a record somewhere of the cell's initial value (the reference for what constitutes a change). This need not be in the same sheet. Say that reference is a named range Tigger that represents the 'initial' value of say C6 in the sheet with the cell whose colour is to be changed.
Select C6 then Format, Conditional formatting..., Format cells if..., Custom formula is:
=$C$6<>indirect("Tigger")
choose red fill and click Done.
The colour is lost if the cell returns to the initial value (unless the content of the named range is modified to have itself been changed meanwhile).

Related

Conditional formatting based on a range of names

I'm trying to make conditional formatting that changes the color of a cell (Red, Blue, Green) based on a range of names on a different sheet. What I have is three lists of names that are either Red, Blue or Green. When I make a list with these names on a separate sheet I want the formatting to change their color to the ones assigned.
The formatting I want to make is something along the lines of "IF the value (name) in this cell is the same as the value (name) in any of cell in a range on another sheet it should change the color automatically.
Here is a link to a sheet where I tried to set it up they way I wanted it to look but I still can't get the formatting to work
https://docs.google.com/spreadsheets/d/1i1DM8X6gyRNMUmYBAtuupeuCUA1iB4LhMDwkD7PHi8w/edit?usp=share_link
I was trying the conditional formatting tool with formulas but I kept getting errors with the formulasenter image description here The picture is in Swedish because google sheets would keep defaulting back to it regardless how much I tried.
One thing is that Conditional Formatting doesn't allow you to directly refer to another sheet. You can do work it around via INDIRECT.
And to compare to several texts, you should not choose the option text contains, but you can find useful REGEXMATCH and TEXTJOIN:
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!A2:A11")))
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!B2:B11")))
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!C2:C11")))

Google Sheets Conditional Formatting based on the cell directly NEXT to, across the entire row

I am looking to show color changes based on decreasing values. I want to add conditional formatting to a row (row 9) based on the cell directly prior (B9<C9 I want to be green, C9>D9 I want to be red). I want an entire row to be conditionally formatted to show growth/decline based on the cell directly before. Is this possible? How can I do so? enter image description hereI have the formulas I want to use, but I don't know how to accurate apply them to the entire Row 9 (as of now I'm manually inputting the 3 custom conditions on each cell)
You can use the following Custom Formulas from Range C9:9. Feel free to interchange the background color that will fit your needs.
For Green (Increasing), =C9>OFFSET(C9,0,-1)
For Red (Decreasing), =C9<OFFSET(C9,0,-1)
For Yellow (Same), =C9=OFFSET(C9,0,-1)
OFFSET() lets you shift the rows/columns based on a reference cell.
In this custom formulas, I get the previous cell value referenced to the current cell by setting the offset_columns to -1.
Sample:
Output:

Conditional Formatting cells in column up to and including the last one with text entered

I am using Google Sheets and trying to write a custom formatting rule that seems like it should be simple. I am trying to figure out how to conditionally format all the cells in a column INCLUDING AND ABOVE (but not below) the cell that meets my condition.
I've found a lot of things that will format the entire column, but that's not what I'm looking for.
The image below is a basic example that I manually colored in to do what I want.
It's for my budget spreadsheet, where each row is an entry from a particular date. I have an "Agreement" column that is empty except when I enter the date that I reconciled the budget. I want it to color that cell and all the empty cells above it green, signifying at a glance: "everything up to this point is ok/has been checked over". Then as time goes by, and I enter another date several rows below, I want it to extend the colored shading up to there.
I've been searching, but it is hard to articulate this; if I say "until this cell" I get results for "shade cell until text is entered"; any mention of "above" and "below" generally relates to the values in the cells; I've found some things about Indirect but just for a single cell above, not for all cells above the current cell.
Wondering if this is even possible...
Google Sheets example
If you create a conditional formatting rule for column A using a Custom Formula you can use this formula:
=COUNTIF(ROW(),"<="&LARGE(ArrayFormula(IF(ISBLANK(A1:A100),"TRUE",ROW(A1:A100))),1))
The larger the ranges you use, the slower it will be however.

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.

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