40
votes
Accepted
Apply conditional formatting if other cell is not empty
The ISBLANK formula should serve your purpose well.
Create a new rule in the conditional formatting menu. Set the range of your rule to D2:D so that the formatting is applied to column D. Then, in ...
36
votes
Accepted
Conditional format rule "Text Contains" with a "+" misinterpreted as a formula
Use ~ (tilde) to escape + (plus sign), = (equal sign) and also other special characters like * (asterisk) and ? (question mark) that are used as wildcards.
References
Apply conditional formatting ...
35
votes
How do I change a cell to the color of the hexadecimal value of a cell in Google Spreadsheets?
=sparkline(1,{"charttype","bar";"color1",A1})
This will provide a solid colored cell using the Hex color code in A1.
Also accepts some named colors as well, e.g. "...
30
votes
Accepted
Conditionally format by day of the week
I had been struggling with this for a long time, but finally cracked it:
Use conditional formatting on the column with the dates and type the following as a custom formula:
=or(WEEKDAY(A1)=1,WEEKDAY(...
20
votes
How do I make the "Text contains" evaluate multiple values in Google Spreadsheet?
IMO better without "Text contains".
To avoid the possibility of conflicting rules, clear all conditional formatting from ColumnA (assumed because OP does not say where the data is), select it and ...
20
votes
Accepted
How to create a checkbox column, that if selected will create a strike-through across the entire row in Google Sheets?
Conditional formatting: If checkbox ticked in cell A1, change color/strikethrough of cells from B1-F1.
Insert a checkbox from "Insert" tab to A1.
Select the cells (B1-F1) that needs to be of ...
12
votes
Accepted
Conditional formatting with multiple criteria for a range of cells
Writing a formula that satisfies your criteria is a matter of breaking down what your criteria are and implementing corresponding Sheets functions.
You have established that the formatting should be ...
10
votes
How to refer to 'this' cell in a conditional formatting formula?
This is the shortest possible way I've found to reference the current cell in conditional formatting spanning a range: INDIRECT("RC",FALSE). Documentation is here.
10
votes
Accepted
Combine Custom Formula with Colour Scale in Conditional Formatting
This is now possible by inserting a formula instead of a static number into the box for min/mid/max amount.
7
votes
Accepted
How do I change a cell to the color of the hexadecimal value of a cell in Google Spreadsheets?
Short answer
Use Google Apps Script or a Google Sheets Add-on as there is no built-in feature to set cell background color by color codes.
Explanation
Google Apps Script is a tool that can be used to ...
6
votes
Conditionally format by day of the week
If the dates are in column A, select them, then do: Format > Conditional formatting... > Format cells if... > Custom formula and put
=and(isblank(A:A)=false, or(weekday(A:A)=1, weekday(A:A)=7))
Some ...
6
votes
Advanced date logic in Google Spreadsheets
In case you need more precise times than in the accepted answer, you can use DATEDIF to specify a certain difference between dates.
Example: format cell A1 if date in A1 is older than 10 days.
...
5
votes
Automatically add borders around nonempty cells
I could do it just by using conditional formatting in MS Excel and then importing the book to Google sheets.
It keeps the conditional formatting of the borders as long as I don't touch conditions for ...
5
votes
Accepted
Using MAX in conditional formatting only evaluates numbers after the cell, regardless of range
Insert $ between A and 2 in the formula. As CF 'steps through' to test each cell in the range in turn the range is being automatically adjusted. So when for example testing A9 it is checking for the ...
5
votes
Accepted
Using setBackgroundRGB() over setBackgroundColors()
As you (maybe) know, the fact that a method is "deprecated" does not mean it doesn't work - just that it might be removed in the future.
So you're probably not getting an error, but a warning, and ...
5
votes
Accepted
Is there a way to lock or protect conditional formatting in Google Sheets?
I'm afraid that currently it's not possible to use cut & paste / drag & drop. Consider to send a feature request directly to Google through Google Feedback: Click on menu Help > Report a ...
4
votes
Highlight all cells in a range that contain a formula in Google Sheets
Note that it is also possible to use conditional formatting as in (for your case):
=isformula(a1)
This kind of specification is more flexible than the whole range answer. For example, lets say in ...
4
votes
Accepted
How to apply a relative reference in conditional formatting formula?
Try this:
=INDIRECT(ADDRESS(ROW(),COLUMN(),4))/REGEXEXTRACT(INDIRECT(ADDRESS(ROW()+1,COLUMN(),4)),"\((.*)\)")*1>1
INDIRECT
ADDRESS 1
ROW
COLUMN
1 The third parameter in ADDRESS() is ...
4
votes
Accepted
Google Sheets Alternate Row Color by Unique Sorted Values
Scenario
If you have 500 items, in column B, but only 20 of them are unique invoices due to them being broken up into purchase orders. It makes sense to keep them separate so you can more easily ...
4
votes
How to create a checkbox column, that if selected will create a strike-through across the entire row in Google Sheets?
Assuming (1) your checkbox is character ☑ (Code 9745) and your entire row runs to ColumnZ, then please select ColumnsB:Z and apply a Custom formula is of:
=$A1="☑"
with formatting of Strike-through ...
4
votes
How to create a checkbox column, that if selected will create a strike-through across the entire row in Google Sheets?
Based on the answer from Rubén, I stumbled into a way to do it across the whole spreadsheet. It worked for me as follow:
Insert a checkbox from "Insert" tab to H1 (in my case)
From tab above, "Format"...
4
votes
Accepted
Conditionally format row borders
The process that would generate a script that makes mentioned conditional formatting includes of course what you mentioned you are unfamiliar with: scripting.
A) Learn the basics of google apps ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
conditional-formatting × 497google-sheets × 488
formulas × 139
google-sheets-dates × 23
google-apps-script × 20
google-sheets-arrayformula × 17
google-sheets-query × 8
formatting × 8
regex × 8
date × 8
google-sheets-cell-format × 8
data-validation × 5
regexextract × 5
google-sheets-custom-function × 4
microsoft-excel × 4
google-forms × 3
google-workspace × 3
importrange × 3
vlookup × 3
concatenate × 3
google-sheets-filter × 3
search × 2
google-sheets-charts × 2
if-this-then-that × 2
google-sheets-timestamp × 2