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 :)
Related
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.
I've got a Sheet.
And I've put some conditional formatting in it.
Basically I want it to highlight the row red of the end column says Not Built
The condition works fine, but for some reason instead of highlighting the whole row, it only highlights the first column.
In My screenshot i've set the range as L7:N (it's Actually A7:N, but I changed it to L to fit in the screenshot)
As you can see it's highlighting the rows where column O says Not Built but for some reason it's only highlighting Column L instead of Columns L to N
I Could create a rule for each Column, but that just seems silly
you need to lock the formula with $ like:
=$O$7:$O="Not Built"
https://docs.google.com/spreadsheets/d/12TsEEj3LQSIOv2m6LRRS6FCLvIkuUo_ECfQvK4gw4d8/edit?usp=sharing
I want to use conditional formatting to count the amount of times a name appears in Column H and make the corresponding name in Column B red if it shows up once and crossed out if it shows up twice.
How can I do this? I used COUNTIF but I don't know how to attach the formatting to a specific name/string in Column B so it just formats the next one on the list (I think).
Any advice or help would be greatly appreciated.
Clear any conditional formatting from ColumnB, select B3 to the end of your range to format and Format, Conditional formatting..., Format cells if... Custom formula is and
=countif(H:H,B3)=2
with strikethrough. Add another rule (same range) with Custom formula is and
=countif(H:H,B3)=1
with red fill and Done.
I have two columns A and B
I'm trying to format A based on drop-down selection from B
I did:
"Custom formula is": =$B:$B="Waiting"
Background Color: red
Range: A:B
but it does not seems to work unless I write "Completed", in stead of having a drop-down in the B cell.
Does that mean, drop-down is not supported in this case?
https://docs.google.com/spreadsheets/d/1xWijibYk__jHku9UIi4tIjIb607wSbfDbdCj8K2-gt4
Conditional Formatting rules applied to a range work like dragging a formula, adapting relative references.
That means if you want to apply a conditional formatting on A1:A20 if column B is "Waiting" you need to use the rule =B1="Waiting",
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(),)))