google sheet conditional formatting for grading - google-sheets

On my google sheet for its form, I have the answers in Row 2.
There are 109 columns in which I need to check if the descending rows of each column match the contents of Row 2 of that column. On top of that, I have to have conditional formatting for the cells that DO NOT match the contents of Row 2 in their respective column.
Is there a way that I don't have to add a formula to each any every column?

You can do this with conditional formatting - for the "apply to range" section (pretending your data starts in column A and ends in D, although in reality you will put whatever the last column is) enter in
A2:D
then for the rule, choose custom formula and enter in this exact formula:
=if(eq(indirect(address(row(),COLUMN(),4)),indirect(ADDRESS(2,column(),2)))=TRUE,FALSE,TRUE)
This will dynamically highlight all of the answers that do not match the value in row 2

Related

Conditional Formatting blanks if cell in another column is NOT blank

I have a sheet with Columns A-Y.
Column A is a prefilled set of numbers 1-200
B-Y are filled in by the end-user.
I am trying to highlight the empty cells based on Column B.
For example, the end-user enters the Date in Column B but does not complete the rest of the row, it would highlight each cell that is blank.
Please use the following formula
=NOT(ISBLANK($B3))*ISBLANK(B3)
(do adjust ranges and locale syntax to meet your needs)

How to highlight a row if two cells in the row not contain the same text

I need to set up conditional formatting in Google Sheets to highlight an entire row if the text in column D is not found in column C in each row.
Custom formulas tried:
=COUNTIF($C:$C,$D2)
tested to get the rows to highlight if the cells in column C are the same as column D. This worked (but I need it to highlight the opposite rows - if they are not equal) if there is only one entry in column D.
=AND($C2<>"", NOT(COUNTIF($C2,$D2)))

Google sheets; Compare data in 3 columns & rows and highlight cells if similar data

Right now I am tasked to compare similar data across 3 columns and its respective rows and then highlight them.
I was wondering whether if it is possible to format the spreadsheet so that the cells highlight on their own across their respective rows when similar data is entered into the cells.
I have attached an example in the link provided !
OK select the range you want to format then go to Format | Conditional format | Add new rule and choose the last option (Custom formula is...) under Format cells if...
Enter the following formula (adjusting range to how many rows and columns you have in your data)
=countifs($A$2:$A$18,$A2,$B$2:$B$18,$B2,$C$2:$C$18,$C2)>1
and choose the fill colour that you want.
The formula counts how many rows there are whose first three columns match the first three columns of the current row. If the result is greater than one, there is a duplicate and the current row should be formatted.

check if a list of words from a column is used in sentences in other columns

I have a column(A) with cells of words where I want to highlight words that are used in other Columns containing sentences not single words. How is this possible?
With conditional formatting and a custom formula
=regexmatch(B1, join("|", filter($A:$A, len($A:$A))))
it worked that the cells in Column B or C where highlighted whenever they used a word from the cells of column A, but I need it the other way around.
Cells in column A should be highlighted whenever words from there are used in sentences in Column B or C
In this example, Column A contains the words and the words should be highlighted if they are used in Sentences in all rows of Column B or C.
Column A:
Sausage
Wiener
Brat
Column B:
I like Sausage
I don't like Steaks
Column C:
I like Brat
Here is my public Spreadsheet:
https://docs.google.com/spreadsheets/d/1ARDvwRJAPG4uXL-IyT4Qv3P0RQMFDj4OviM3GKK5Blg/edit#gid=0
=AND(LEN(A2),SUMPRODUCT(IFERROR(FIND(A2,$B$2:$E$3))))
Apply to:
A2:A
I believe, this Custom Formula for the range B2:B1000 should work:
=AND(LEN(A2),SUM(ArrayFormula(--REGEXMATCH(B2:E2,A2)))>0)
Select the cells you want to format.
Click Format and then Conditional formatting.
Under the "Format cells if" drop-down menu, click Custom formula is.
Click formula and add the formula
Click Done.
Instructions
Notes:
Check LEN(A2) to skip empty values
ArrayFormula(--REGEXMATCH(B2:E2,A2)) will return all matches with RegexExtract. Double minus -- is to convert boolean true to 1, and false to 0.
second condition SUM gives 1 and more if at least one match was found.

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