Google Sheets Conditional Format for Multiple Columns - google-sheets

I am using google sheets. For column E, under the header “Received” I have formatted it so that when you type in "no" the color of that cell turns red. But when you type in “yes" then the color of the cell will change to green.
How do I get column F (column to the right of Column E, under the header “Total”) to automatically display the number "20" AND also the make it’s cell
turn to green whenever the cell next to it, in column E says "yes"? And if I type in “no” in Column E id like the cell next to it in Column F to say “0” and the background color change to red.
Please help!
I asked ChatGPT it said to use the formula =IF(E2=“yes”,”20”, “”) however this didn’t work. It only changed column F background color to green but it didn’t change the cell to say “20”

These are two separate things. One is the formula inside the cell that determines the value of 20 or 0
=IF(E2="","",IF(E2=“yes”,20,0))
Or you can set it as an array formula in F2 to expand to lower rows. Put this in F2:
=ArrayFormula(IF(E2:E="","",IF(E2:E=“yes”,20,0)))
Other thing is the conditional formatting rules that set the colours. Select F2 column and choose conditional formatting. Look for custom formula and you can use:
=E2="yes"
=E2="no"
For green and red respectively. Try these things and let me know

I was able to to get it right using the formula =IF(E2="yes", "20.00", "0.00").
That did the trick, and to change the colors I did conditional format and set it to Text contains: 20and changed the color to green. I added another rule except this time I put Text contains: 0.00 and changed the color to green.

Related

Conditional formatting if cells in row are less than header

I am trying to find a way to have a cell in column A turn yellow if any cell in the adjacent row is less than the value of its corresponding header. Please see my example sheet.
I'm trying to use this formula for my conditional formatting: =COUNTIF(B5:5,"<"&B$4)>=1 but I believe it's stuck on using Cell B4 as the header value for the entire range (instead of C4 for column C, D4 for column D, etc).
Any ideas on what I'm missing here?
For the red option, as you suggested, you should use:
=COUNTIF($B5:$H5,"")
But you may keep it that option above, so it is red even if there's an orange
Then, for yellow you can use:
=COUNTIF(BYCOL($B5:$H5,LAMBDA(each,each<OFFSET(each,4-ROW(each),0))),TRUE)
It checks in each column if the value is smaller than in row 4, and counts the amount of TRUE values
And green should be by default, I understand. Is it useful?

Conditional format cell based off other cells

I want one cell that's blank to change colors based off another cell containing text. But once the blank cell has a text put in I want the color to go away. I have not tried anything because I'm unsure how to code this.
So if
A1(contains text),B1(blank cell) turns red. Once B1(contains text), B1 turns white.
I only want B1 to turn red if A1(contains text).If A1(is blank) I want B1 to stay white.
Format -> Conditional Formatting -> Apply to Range B:B
Custom Formula is =and(A:A<>"",B:B="")
if column A has a length greater than 0 and column B has a length equal to 0 make column B red.

How Do I Highlight a Cell a Certain Color if the values in two other cells match?

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.

Conditional Formatting with lots of data

Anyway, I have a table in Google Spreadsheets that has a set of rows which each contain a name (Column A) and two Yes or No values (Columns G and H).
I would like a way to conditionally format the rows. I have been trying to learn the formatting but I feel this is well out of my league. The way I would like it all to be formatted is only in Column A. If G says "Yes" and H is empty, then yellow. If G says "Yes" and H says "No", red. If G says "Yes" and H says "Yes", green.
If it helps, here is a chart:
G H
Y -- Yellow
Y N Red
Y Y Green
An explanation of how it all works would also be much appreciated but if you only have the solution on how to do it, I will gladly take that.
METHOD 1 - Conditional Formatting Only
The easiest way to do this, using Conditional Formatting is as follows:
Select "Format >> Conditional Formatting":
These IF statements will be used color the cells Yellow, Red, and Green, respectively.
=IF(AND(G2="Yes",H2=""),"True")
=IF(AND(G2="Yes",H2="NO"),"True")
=IF(AND(G2="Yes",H2="YES"),"True")
METHOD 2 - New Column, using f(x), and Conditional Formatting
The code used to generate the text "Yellow," "Red," and "Green" is as follows (broken up in 2 lines only for easier readability):
=IF(AND(B2="Yes",C2=""), "Yellow",IF(AND(B2="Yes",C2="No"), "Red",
IF(AND(B2="Yes",C2="Yes"), "Green")))
This is a nested IF statement that will examine your "Yes"/"No"/null column cells. This statement looks for the conditions you specified and returns either "Yellow," "Red," or "Green" in a separate column.
Since your IF statement will output either "Yellow," "Red," or "Green," all you'll have to do is set your Conditional Formatting to look for these words and color the cell accordingly.
A great resource to learn more is the Google spreadsheet function list.
I've got it for you. It can be made using the conditional formatting in Google Sheet.
A Screen Shot attached
Right click your cell A, apply conditional formatting
Just apply it across your range in column A1:A500 something
and choose the "Format cells if..." and choose custom formula
(Just click Add another rule after each one so you don't have to repeat the range)
=IF(AND(G60="Yes",H60=""),"True") //Change the color to Yellow
=IF(AND(G60="Yes",H60="No"),"True") // Change the color to red
=IF(AND(G60="Yes",H60="Yes"),"True") // Change the color to green
You will have 3 rules of conditional formating
replace G60 and H60 with the starting row number
Edit ------------------ Forgot to add the explanation
The formula
IF(AND(G60="Yes",H60=""),"True")
"IF" is to check IF something is this or not. I added the "AND" so that we could put in 2 condition, since we need both conditions to be satisfied. and therefore the formula above in written form would be
IF(IF) BOTH(AND) G60 and H60 is "Yes" and "Empty" respectively, then it is True. So it will become the color I chose.
There might be another way to write the codes but this works :)

Custom Conditional Formatting formula

I'd like to use Conditional Formatting in Google Sheets to color in a whole line based on certain criteria:
Color the line red if Column D contains a specific Value AND Column L is not empty AND Column S is empty.
Color the line green if Column D contains a specific value AND Column L is not empty AND Column S is also not empty
Do not color the line if Column L is empty, regardless of whether Column D or S have values.
So far, here's what I've tried:
=$D:$D = "specificValue"
This will color in any line in which Column D contains the specific value
=$D:$D = "specificValue" & $S:$S
This will color in any line where D contains the specific value and Column S is empty. Close, but not quite what I need.
=$D:$D = "specificValue" & $S:$S <> ""
This will Color in the whole range that I am applying the conditional formatting to.
=$D:$D = "specificValue" & $S:$S & $L:$L
This will color in any line where Column D is the value, AND BOTH Columns S and L are empty. A value in either S or L will make this line not colored. This is problematic. If D AND S have values but not L then it doesn't need to be colored. If D and L have values but not S then it needs to remain colored until I have S filled in.
Please select all the relevant cells in your sheet and Format, Conditional formatting..., Format cells if..., Custom formula is enter:
=and($D1="specificvalue",not(isblank($L1)),isblank($S1))
and for Formatting style choose red fill, Done.
Then repeat with Add new rule:
=and($D1="specificvalue",not(isblank($L1)),not(isblank($S1)))
with green fill.
The formulae are a little more verbose than really necessary but hopefully make it more obvious what is happening, as I suspect you might need to make some adjustment. Note that formatting an entire sheet may be slow. You might want to turn "specificvalue" into an absolute reference to a cell containing specificvalue.

Resources