Conditional formatting depending on the extreme values of each row - google-sheets

I'm trying conditionally to format a Google Sheets sheet with 1,000 or more rows. I have to colour it depending of the highest and lowest value of each row.
(Red=highest,green=lowest) I want to make the second example without having to write every row B1:F1,B2:B2, etc, because it is a large document.

In conditional formatting, you need to select B7:F9 and add a custom formula
=rank(B7,$B7:$F7,true)=1
then choose dark green fill colour.
Then add another rule
=rank(B7,$B7:$F7,true)=2
and choose light green fill colour.
Then repeat until you have a rule for each of the five colours.

Related

Conditional formatting based on a range of names

I'm trying to make conditional formatting that changes the color of a cell (Red, Blue, Green) based on a range of names on a different sheet. What I have is three lists of names that are either Red, Blue or Green. When I make a list with these names on a separate sheet I want the formatting to change their color to the ones assigned.
The formatting I want to make is something along the lines of "IF the value (name) in this cell is the same as the value (name) in any of cell in a range on another sheet it should change the color automatically.
Here is a link to a sheet where I tried to set it up they way I wanted it to look but I still can't get the formatting to work
https://docs.google.com/spreadsheets/d/1i1DM8X6gyRNMUmYBAtuupeuCUA1iB4LhMDwkD7PHi8w/edit?usp=share_link
I was trying the conditional formatting tool with formulas but I kept getting errors with the formulasenter image description here The picture is in Swedish because google sheets would keep defaulting back to it regardless how much I tried.
One thing is that Conditional Formatting doesn't allow you to directly refer to another sheet. You can do work it around via INDIRECT.
And to compare to several texts, you should not choose the option text contains, but you can find useful REGEXMATCH and TEXTJOIN:
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!A2:A11")))
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!B2:B11")))
=REGEXMATCH(A2;TEXTJOIN("|";1;INDIRECT("'Name sheet'!C2:C11")))

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:

Conditional formatting colliding in Google Sheets

First condition: Give a strike-through to the list when checkbox is True.
Second condition: Highlight every 3 rows for readability.
The problem is that I want the first condition to give only strikes, but it also change the background color. I don't want to change the background color.
Answer:
Google Sheets doesn't allow you prioritise conditional formatting statements, but you can achieve this by modifying and adding a third rule.
More Information:
At the moment, you have two conditional formatting rules:
The one which colours every three rows, set on the rows of the sheet:
=AND(MOD(ROW() ,6)>0,MOD(ROW() ,6)<4)
And the one which sets the text in column B to strikeout if the respective checkbox in column A is checked, set on column B:
=A1:A=TRUE
The problem is that the strikeout rule will not ignore the other conditional rules, and so will not honour the first rule which sets the row colour.
Fix:
Firstly, you can keep the formula which colours the rows:
=AND(MOD(ROW() ,6)>0,MOD(ROW() ,6)<4)
Making sure that the Formatting style is only for the row colour.
You will then need to have two additional rules which keep both the formatting of the colour, as well as the strikeout:
The first, will affect rows 1-3, 7-9, 13-15 etc. For this, your formatting style should be the correct colour for rows 1-3, as well as the strikeout:
=AND(AND(MOD(ROW(),6)>0,MOD(ROW(),6)<4),A1:A32=TRUE)
And the second will affect rows 4-6, 10-12, 16-18 etc. For this, your formatting style should be the correct colour for rows 4-6, as well as the strikeout:
=AND(A1:A32=TRUE,OR(MOD(ROW(),6)=0,MOD(ROW(),6)>4))
Showcase:

Highlight cells a different colour for each number of occurrences of a string

I have a sheet where we choose what people will be assigned to each job. The job assignment will be on "Sheet" (in my sample spreadsheet). I would like the list of people on the "Pick List" sheet to be highlighted a different colour for every time they are assigned in "Sheet" more than once. I would like one assignment to be green, 2 assignments to be yellow, and 3 or more assignments to be red. I have attached the sample spreadsheet where I have tried a few solutions that are not working. Any help is greatly appreciated.
Sample Spreadsheet
The easiest way to do this is with conditional formatting.
On Sheet, select A1.
Right click and select conditional formatting.
You will need three rules. They will all be custom formulas (find under format cells if).
First enter =countif(A:A,A:A)=1 in custom formula is. Apply to range should be A1:A. Set formatting style to Green. Click Done.
then click add another rule. Custom formula will be =countif(A:A,A:A)=2. Apply to same range. Formatting style to Yellow.
Add another rule =countif(A:A,A:A)>=3 for Red.
You really don't need Pick List unless you just want to validate against it. If you do want to validate, you can
right click A1.
choose Data Validation and enter your Pick List range 'Pick List'!A1:A.
Drag A1 Down in Sheet.

Google Sheets, Conditional Formatting by Percentage Categories

I'm looking to create some conditional formatting based upon a set of three percentage categories (please see the following sheet), where a color is applied to multiple cells, but not all in a row:
90% - 100%: Green
50% - 89%: Yellow
0% - 49%: Red
I'm able to get the percentages to change color based upon their content, but so far I've not been able to apply this change to the other cells. Is there a conditional formatting custom formula that I can use to do this?
For range F3:H26 make 2 rulus with 'your formula':
=$F3>=0.9 -- green
=$F3>=0.5 -- yellow
and paint the range in red.
That's it!
Look at example
Select all the cells that you want the rule to apply to
Go to: Format > conditional formatting then in the tool bar on the right, click add new rule
By format cell if section select "is between" and enter the criteria. Hit done
Now click add new rule below the first one and repeat as above
this should work
When putting in conditional formatting with cell that has a percentage value in it you need to give ranges in the range of 0 to 1. In other word to set a format for range between 10% and 40% you would select "Is Between" and for values put in 0.1 and 0.4. This will apply formatting correctly. For percentages over 100% use 1.xx over 200% 2.xx etc...

Resources