Can anyone assist me regarding conditional formatting in google sheets? It's pretty simple, though I can't seem to get it to work, my goal is to highlight or color the cell green (AQ) if (AR) is Y and red if (AR) is N. The custom value I'm trying to use is =$AR="Y". Then I choose background color green; however, it's not working. Please assist me. Thank you very much...
Neither AQ nor AR is a valid cell reference. Use AR1 or whatever cell you are relying on. Google's documentation is pretty good on the subject: see here.
Relative Reference Example
The following example highlights each cell in the range AQ1:AQ11 green if "Y" or "y" is in the adjacent cell in column AR.
Absolute Reference Example
If I wanted every cell in the range AQ1:AQ11 to be colored green based only on the value of AR1, I would use =$AR$1="Y" as my formula instead.
Related
Is it possible to check a cell's conditional highlight colour and act accordingly?
I have a list of Names where some people belong to the "Yellow" team and some the "Pink" team. The Yellow team get more points allocated depending on their level (Cell B3).
Referring to the screenshots attached, I can't work out how to direct the lookup to the appropriate column of points per level in 'Sheet2' relative to the chosen Name. Conditional highlighting (see screenshot) sets the cell colour according to the Name input into cell B2.
Cell B6 contains the following formula:
=vlookup(B3,Sheet2!A1:E11,match(B2,Sheet2!A1:E1,0),)
The formula worked when the reference table had Column B named as "Bob" but that is not what I want.
I want the B6 formula to realize which colour team the B2 Name is and pick from the appropriate data set in 'Sheet2'.
Any help appreciated if it is at all possible to lookup against cell highlight conditions.
Thanks!
There's no direct way of doing it. You might want to use the getBackground() function in Google apps script, but I don't think it's worth using scripts for this case. That would mean making the thing more complicated and less maintainable.
The easiest way you can achieve it is by using a helper cell.
You'll need the two teams listed in two columns. I'll assume to make things simple to have the two ranges E2:E30 for yellow names and F2:F30 for pink names
Add Color in cell A4 and the following formula in B4:
=IF(ISERROR(MATCH(B2,E2:E30,0)),IF(ISERROR(MATCH(B2,F2:F30,0)),"No color","Pink"),"Yellow")
You could then use the result of cell B4 for the VLOOKUP in cell B6.
The added advantage is that you wouldn't need that many conditional formatting rules: you can simply compare the color in B4 and assign a conditional formatting rule accordingly in B2. It's way more maintainable and less error-prone.
Using Named Ranges for conditional formatting (no script, no helper cell)
Since Francesco's excellent proposition on using formulas instead of a script is your choice, you could also try the following.
Turn your team ranges to Named Ranges (by going to Data>>Named Ranges from the top menu) and name them e.g. yellow and PINK
Apply conditional formatting to your data validated cells (B3:E3) by using these two formulas (under Custom formula is found at the end of Conditional formatting rules):
=REGEXMATCH(B3,""&JOIN("|",FILTER(INDIRECT("yellow"),INDIRECT("yellow")<>""))&"")
and
=REGEXMATCH(B3,""&JOIN("|",FILTER(INDIRECT("PINK"),INDIRECT("PINK")<>""))&"")
(Make sure you adjust your ranges according to your data)
Advantages:
It is your original cells that get color coded.
Named Ranges can be placed anywhere, on any tab and can grow to your needs.
You do not need the extra helper cell.
Make a note:
We must use INDIRECT when using named ranges with conditional formatting for the function to work.
We must also surround the named range with double quotes "". So, to refer to the named range yellow we use INDIRECT("yellow).
I have created a Directional indicator (Green up arrow and Red down arrow) in my SSRS report, referring to the value of the column next to it. This all works ok:
However, I really want the indicator and the value to be in the same cell, like Excel can:
A Google found the following article , where the last post suggest it is possible using the following syntax:
=Format(Fields!Column1.Value, "Format") + " " + "Indicator"
I assume "Indicator" refers to the name I gave to my Direction indicator, but I can't get it to work..
I have read that by using border formatting I can get my two cells to look like one, but I would ideally like it all to be in one.
Any thoughts appreciated!
Mark
I would do this by placing a Rectangle inside of the cell and place your indicator along with another text box inside the rectangle. The downside to this is (depending on how you align the items in the rectangle) the formatting may cause split cells in excel exports.
Ross's method will work and there are alternatives..
The article you referenced was a text indicator not an image (from what I could tell).
You could do something similar by simply adding a a placeholder in the cell (right-click inside the cell and click "create placeholder"). You can then set the font and colour independently from the rest of the cell.
You could use a common font such as wingdings to get arrows and then the value and color properties would be expressions to show the correct 'character' (arrow) and the correct colour.
I have a spreadsheet that looks like (but much larger):
Both the student names and the house assignments are pulled from other sheets.
I am looking for a google script that would conditionally format a student name based on the house they are assigned to. The house assignment will always be listed in the cell to the right of the name.
I realize this can be done with conditional formating (For instance: Custom formula =B3:B4="6-Blue"), but it becomes an arduous process because I have to go into each vertical range individually to make a change if the house name changes. With a google script, I could find and replace all instances of a house name.
Something like Eric Koleda's answer may work, but I am unsure how to reference the ranges and add multiple values to search for.
You can still do this with conditional formatting!
You can set up conditional formatting on a per column basis, you don't have to change the formatting, only the name of the color in your house column.
Conditional formatting formula: =ISNUMBER(FIND("Red", $C4))
Conditional formatting range: B4:C
This will try and find the text Red within all cells in Column C starting at C4. If Red is found in a cell, FIND() will return the index of Red, if it doe snot find Red is returns an error. You can check this with ISNUMBER(), which returns true or false if the value is a number or not.
This will color the adjacent columns on that row within the range. ie. A range of B4:C will color the cells in column C and B, a range of just B4:B will only cause the cells in column B to be colored.
You only need to setup one conditional formatting per color, per set of columns that you have. After that, just changing the colors under your houses will change the formatting.
Here is an example sheet I made for you: Example Google Sheet
Picture of Sheet with formatting:
I need to change the background color of a certain range of cells based on a list of values (9 possible) in a single cell. I want the background change to happen across multiple different tabs.
Range of Cells: Tab 1(A1:L1, A3:L3, A33:L33) Tab 2(A1:X1, Column C) Tab 3(A1:M1, D5:G5, Column D, Column, G) There are many more, but I think if I see how it's done, I can play with the code enough to make it work!
Cell: Tab 2(B3)
Values: 'The Reach' = green, 'The North' = light grey, 'The Iron Islands' = dark grey, 'The Riverlands' = dark blue, 'The Vale' = light blue, 'The Crownlands' = dark red, 'The Westerlands' = red, 'The Stormlands' = gold, 'Dorne' = orange
To be honest, the colors don't matter. If you can make the code, I can just tweak the background colors with specific hex code. Also, if possible, could text color be changed as well?
I'm not sure how to begin this, as I have no expertise coding. Would any of you be able to help? Sorry if this is a lot work, I just have NO idea.
This is the sheet I'm working with. I basically just want to change the headers when the region changes.
If you just want to trigger colors changes, I would give the built-in conditional formatting a try first. If you need help formulating a statement after reviewing that, there's already numerous examples / threads in the official Docs Product Forum that use the "Custom formula is" box.
At this point, the only reason to get a script involved is to trigger some thing more advanced to happen when your cell value changes like sending an email or moving a row.
This is just a 'general guide' (ie I can't be bothered to set up and explain nine different colours in three different tabs and multiple ranges). First give B3 in Holdfast Information a name - say Region. Then apply a conditional formatting rule to Income Row 2 of say:
Custom formula is =row()=2 Format: Text Colour: Black, Range: 2:2.
(To allow the next rule to apply to A1:L3.) Then:
Custom formula is =indirect("Region")="The Westerlands" Format: Text Colour: of your choice, Background Colour: Red, Range: A1:L3.
As an aside, you should perhaps be applying a lookup rather than that horrible formula in B3.
I am using Google spread sheet as my bug sheet,i have mark some bugs as fixed and had highlighted that row with some color ,know i want to see all those fixed bugs row .how can i apply filter for it?
I don't understand the question. Do you want to make it so that the cell turns a different color if a certain text, such as "Error", or "Fixed" is entered in? If so, go to where you change the background or text color in the menu, go to "Conditional Formatting", and enter in the rule
Text Contains: Error. Format: Background color(and change it to the color you want)
Then click "Add Rule" and Do the same thing, except instead of Error, you put fixed. If you do this, then click the box in the bottom right corner of the cell you have just edited, then drag it down to all the cells you want the conditional formatting to occur, every time you enter in either "Fixed" or "Error", it will turn the color you want it to.
If you are trying to sort the row by what is fixed or not, then I suggest you add another column that says "Fixed" or "Still Bugged". After you do this, create another tab at the bottom of the spreadsheet. Once you have done that, enter in =QUERY(Sheet1!A1:F20, "Order by E")
In that formula, the A1:F20 is the table you have if it is debugged, the link, the name, or whatever you have in the table. The Column E is the column in which you have that says if it is fixed or not. Sheet1 the sheet that has all of your data in it.
Hope I could help!