Conditional Format based on values in table - google-sheets

How do I conditionally format each individual cell in B27:AM46 based on the table in A94:B114?
B27:AM46
a94:B114
Copy of Sheet: https://docs.google.com/spreadsheets/d/1oEOcDbQW-QRhjHDY1D04R9XNStyeTKA44GEaPrlh3sk/edit
For example, ARS is 3. Every cell that contains ARS in B27:AM46 would be red.
1 would be grey
2 would be white
3 would be red

Step 01
1 - Click Format and then Conditional Formatting.
2 - Under the "Format cells if" drop-down menu, click Custom formula is.
3 - Add new rule and then Custom formula is.
Click Value or formula and add the formula and rules. for each formula in the following table in step 02
Step 02
Paste this formula for each rule
Rules
Formula
Red
=IFNA(VLOOKUP(REGEXEXTRACT(B2,"(.+) "),$K$2:$L,2,0),"")=1
white
=IFNA(VLOOKUP(REGEXEXTRACT(B2,"(.+) "),$K$2:$L,2,0),"")=2
red
=IFNA(VLOOKUP(REGEXEXTRACT(B2,"(.+) "),$K$2:$L,2,0),"")=3
Notes
The lookup table needs to be on the same sheet.

Related

Conditional Formatting from cells in adjacent column

[inventory sheet] (https://docs.google.com/spreadsheets/d/1kLDo8Up_RJa2rXsEZ9ElKBEhGUTsMw61-fQspOPuBz4/edit#gid=0)
I'm trying to conditionally format column E based on column D. For example, if the value in column D is <8, highlight the adjacent cell in column E green. If value is >7 and <15, highlight yellow. If value is >14, highlight red.
The formula I have now works, but I can't figure how to apply the formatting to the entire column without manually inputting 3+ conditional format rules on each individual cell.
The existing conditional format from your sheet is partially correct, it just needs some tweaking on the Apply to range value. You can create 3 conditional formats on E3 and it will apply to the whole column of E if you put the E3:E on range.
Please see the 3 conditional formats I have created based from your given sheet.
Conditional format 1:
Conditional format 2:
Conditional format 3:
Output:
Reference:
AND function
Just select the whole range and create one single rule per condition. Use the formula as it is created for the first cell and it will "drag" automatically.
For example with =D2>15

How to use conditional formatting for "less than value in previous cell" in google sheets?

I'm trying to apply conditional formatting for cells that are less than value of a previous cell in the same column. For example, if D5 < D4 apply formatting, if D6 < D5 apply formatting, etc down the column.
I created conditional formatting for D5 denoting D4 as =D4 to get it's value. This works, however, when I copy this formatting to the cell below, D6, it does two things:
It does not make a copy of the formatting but updates existing one adding a range (D4,D5).
It still references D4 to check the value against, while I need it to compare against D5.
I'm not sure why D5 is always referenced, since I'm not using absolute reference, but a relative one. I don't see a way to compare with previous cell in the same column other than creating a formatting for each cell. Any pointers?
Found a solution based on another post color red if cell above value is lower:
Select a range where formatting needs to be applied, e.g. D9:D20.
Right click, select Conditional Formatting.
Click "Add new rule"
In "format cells if" choose custom formula is.
Enter formula: =D9
Select desired formatting.

In google sheets, conditional formatting, need custom formula that looks for range between 2 values

I want to change fill colour of one cell based on the value of another. The colour should change based on range of that cell. Ex. Fill cell D8 yellow if value in cell D7 is between 80 and 100.
Try selecting cell D8 and click Format > Conditional formatting > Custom formula is:
=AND($D$7>=80,$D$7<=100)
Select a yellow background and click Done

Conditionally format Google Sheets cell based on text in a different cell

I would like to format cell D2 based on text in C2. I would like D2 to be colored Red if C2 contains text from a drop down of "No" and be colored Green if the text is "Yes". I have tried custom formula containing =IF C2 ("Yes") which Google Sheets seems to accept but he result is not displayed at all.
Select D2 (or D2:D9 or D2:<somewhere further down>)
Choose Format ► Conditional Formatting
Format cells if... Custom formula is...        =C2="yes"
Formatting style - choose a green Fill and click Done.
Add new rule then repeat from step 3 with `=C2="no" and a red Fill.
        
Edit: Actually, if the cell is to have a background of white for anything other than "Yes", then you only need one rule: =C2="Yes" That is, if the default background for the entire sheet is white.
You must add two separate rules to cell D2, one for each color. The formula must look like this:
=$C$2="Yes"
And for anything other than "Yes"
=$C$2<>"Yes"

Conditional formatting, entire row based

I've searched and read through answers related to conditional formatting, but I can't seem to get mine to work, so maybe I'm doing something wrong.
I have a worksheet for work. It contains a list of animals in our shelter. What I'm attempting to do is color the entire row green if they've been adopted (noted by an "X" in column "G"). I've had =$G$2="X" and =$G2="X", but neither work. It'll only color the one row that was active when I set the rule, and when I enter "X" in another row, it does nothing. What am I missing?
Use the "indirect" function on conditional formatting.
Select Conditional Formatting
Select New Rule
Select "Use a Formula to determine which cells to format"
Enter the Formula, =INDIRECT("g"&ROW())="X"
Enter the Format you want (text color, fill color, etc).
Select OK to save the new format
Open "Manage Rules" in Conditional Formatting
Select "This Worksheet" if you can't see your new rule.
In the "Applies to" box of your new rule, enter =$A$1:$Z$1500 (or however wide/long you want the conditional formatting to extend depending on your worksheet)
For every row in the G column that has an X, it will now turn to the format you specified. If there isn't an X in the column, the row won't be formatted.
You can repeat this to do multiple row formatting depending on a column value. Just change either the g column or x specific text in the formula and set different formats.
For example, if you add a new rule with the formula, =INDIRECT("h"&ROW())="CAR", then it will format every row that has CAR in the H Column as the format you specified.
=$G1="X"
would be the correct (and easiest) method. Just select the entire sheet first, as conditional formatting only works on selected cells. I just tried it and it works perfectly. You must start at G1 rather than G2 otherwise it will offset the conditional formatting by a row.
To set Conditional Formatting for an ENTIRE ROW based on a single cell you must ANCHOR that single cell's column address with a "$", otherwise Excel will only get the first column correct. Why?
Because Excel is setting your Conditional Format for the SECOND column of your row based on an OFFSET of columns. For the SECOND column, Excel has now moved one column to the RIGHT of your intended rule cell, examined THAT cell, and has correctly formatted column two based on a cell you never intended.
Simply anchor the COLUMN portion of your rule cell's address with "$", and you will be happy
For example:
You want any row of your table to highlight red if the last cell of that row does not equal 1.
Select the entire table (but not the headings)
"Home" > "Conditional Formatting" > "Manage Rules..." > "New Rule" >
"Use a formula to determine which cells to format"
Enter: "=$T3<>1" (no quotes... "T" is the rule cell's column, "3" is its row)
Set your formatting
Click Apply.
Make sure Excel has not inserted quotes into any part of your formula... if it did, Backspace/Delete them out (no arrow keys please).
Conditional Formatting should be set for the entire table.
You want to apply a custom formatting rule. The "Applies to" field should be your entire row (If you want to format row 5, put in =$5:$5. The custom formula should be =IF($B$5="X", TRUE, FALSE), shown in the example below.
Use RC addressing. So, if I want the background color of Col B to depend upon the value in Col C and apply that from Rows 2 though 20:
Steps:
Select R2C2 to R20C2
Click on Conditional Formatting
Select "Use a formula to determine what cells to format"
Type in the formula: =RC[1] > 25
Create the formatting you want (i.e. background color "yellow")
Applies to: Make sure it says: =R2C2:R20C2
** Note that the "magic" takes place in step 4 ... using RC addressing to look at the value one column to the right of the cell being formatted.
In this example, I am checking to see if the value of the cell one column to the right of the cell being formatting contains a value greater than 25 (note that you can put pretty much any formula here that returns a T/F value)
In my case I wanted to compare values in cells of column E with Cells in Column G
Highlight the selection of cells to be checked in column E.
Select Conditional Format: Highlight cell rules
Select one of the choices in my case it was greater than.
In the left hand field of pop up use =indirect("g"&row())
where g was the row I was comparing against.
Now the row you are formatting will highlight based on if it is greater than the selection in row G
This works for every cell in Column E compared to cell in Column G of the selection you made for column E.
If
G2 is greater than E2 it formats
G3 is greater than E3 it formats etc

Resources