google sheet change background based on text in a cell - google-sheets

I am new in google sheet programming a macro.
I want to use a script for changing the background based on the color writen in a cell. So all the cells checked and find out what color is written.
If there is in cel D7 the text "green", the background from D1:D7 changes into the color green
If there is in cel E7 the text "blue", the background from E1:E7 changes into the color blue
and so one
example
Thanks for thinking

I want to use a script for changing the background based on the color writen in a cell. So all the cells checked and find out what color is written.
I know you ask for a script. You could also use though, conditional formatting rules instead.
Please use the following formulas for the range you need.
=REGEXMATCH(D1:D7,"green")
=REGEXMATCH(E1:E7,"blue")

Related

Google Sheets - Conditional Formatting Color Scale for Text, Not the Background

Why is that the conditional formatting with color scale from Google Sheets only offers background coloring and not text coloring as well, like the single color does?
I have a column of player ratings which I would like to color scale so who's best/better is more easily recognizable — the whole sheet is ordered alphabetically, that's easier to manage overall. However, I think background color scaling is just too much, I would rather have only the text colored.
Is there an extension with this type of functionality?
as of today (17 January 2020) - there is no such functionality internally supported in Google Sheets. as mentioned, you can make an inquiry and request such an option, but there is no guarantee you will get some any soon or any ever.

Google Sheets change background color based on value of another cell

In Google Sheets, is there a way to change not just the value but also the background color of a cell based on one of several possible values of another cell??
In other words,
If A1 is > 2, then B1 should be background color blue
I would like to change the background color of the cell E that are not 0:00. Here: https://docs.google.com/spreadsheets/d/1NSBx87sWScwe2Vtp9FOcH3BupvPJ_jzISUeAk6gSBOM/edit?usp=sharing
What's the syntax to write this kind of matching?
Thanks in advance!
Google Sheets has a native solution for this.
Just right click on the cell(s) you want to change background color and choose Conditional formatting, it is the penultimate option.
Then a right side tab with the different formatting rules will open. There you can define the range, the rules and the formatting style.
Source: https://support.google.com/docs/answer/78413?hl=en

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:

Is there a way to adress the backgroung color in Google Sheets conditional formating?

I am making a Roadmap for a project of mine in Google sheets. I want to set the background color of a row to light red if the row is the current date. I do this with conditional formating. When the row is colored my old background colors are overwritten.
Is there a way to color only cells that have no manual background color?
The light red row works fine, but the darker red underneath should still be seen.
Is there a way to color only cells that have no manual background color?
unfortunately that is not possible. conditional formatting always takes priority over manual colors

How to add background color to whole row if 2 cells in that row have some specific background color in Google Sheets?

I want to add some background color to the rows that have specific colors to two cells in it.
For example, the 4th row has y4 and z4 so if y4 has background color green and z4 has background color red, I would like to add the grey background to the whole 4th row. How can we achieve it?
I tried this based on values in these cells but it is not working =AND(IF($Y1>$AB$6,1),IF($Z1>$AB$9,1)) so now trying based on the background color
please see the screenshot for your reference:
you can't (just like that) set conditional formatting based on color of another cell.
=AND(IF($Y1>$AB$6,1),IF($Z1>$AB$9,1))

Resources