I have made a guest list sheet in Google Sheets with two columns, one of name and one of attendance. The attendance column can have two values, either X (when people don't come) or a number (mostly 1 or 2, but safe to say always bigger than 0).
I've already created a custom formula marking the whole line (including the name) red if there is an X in the second column.
This formula works like a charm!
I now want to do the same thing, but making the whole line (including the name) green if there is a number placed in the column. I've tried replacing the X in the custom formula with 1, 2, 3 etc (also with colons and semi-colons) but that doesn't work.
Does any of you know what I need to do?
Please select ColumnsA:C and: Format > Conditional formatting..., Format cells if... Custom formula is and:
=and(isnumber($C1),$C1<>0)
with green fill for Formatting style and Done.
(Assumes 2 etc are Number format.)
Related
I'm going through a sheet with multiple different data points across different rows (for different versions of the same action each on their own row).
In order to easily compare from one row to the next, I would like to use conditional formatting to on a simple level as follows: - highlight cell green if a value in that cell is equal to or greater than average for that column - highlight cell red if a value is less than average for that column
So for example, I need all cells in column F to be green if the value in each cell is equal to or greater than the average of all values in that column or red if it's less than the average of all values in that column.
But I'm struggling to get that working.
Does anyone have any ideas?
I tried in 2 ways, trying to get a custom formula that calculates this average and merely doing greater than or less than in reference to a specific cell in another column (I have a separate column where I only have the average of each column calculated as follows: =Average(E3:E18) but neither is working consistently, it's highlighting some cells green that should be red and vice versa.
green color:
=IF(AVERAGE(F:F)<=F2, 1)
red color:
=IF(AND(AVERAGE(F:F)>F2, F2<>""), 1)
Maybe what you want is this CF formula rule:
=D2<average(D:D)
applied to the whole of D2:Rx (where x is last row) for red, and a corresponding rule with < replaced by >= for green (or simply format all range with 'standard' fill of green).
I'm trying to track voting attendance for meetings and I'm having varying degrees of successes.
Problem Scenario:
Column H, I, and J contain either a 1 or a blank and represent if they attended one of the last 3 meetings.
For all rows if ALL 3 Columns (H, I, AND J) are BLANK or "", mark that entire ROW RED
Then I need to SUM the number of rows that are marked RED and subtract that from voting members.
I've tried leveraging Conditional Formatting tool > Custom Formula with not much success. Below are some of the things I tried and failed even on the first part of my scenario.
=IF(SUM(H4:J4)>0,false,true)
=ISBLANK(H4:J4)
=IF(ISBLANK(H4:J4),false,true)
=ARRAYFORMULA(OR(ISBLANK(H4:J4))) = FALSE
None of these quite worked as hoped and even copying to each row and pasting conditional formatting also messed up the formula further.
For formatting: Use the Conditional Formatting using the COUNTBLANK(range) formula.
Go to Conditional Formatting
Select the range you want formatted (in your case H1:J50 assuming 50 rows)
Select Custom Format is
Add the expression =countblank($H1:$J1)=3
Select red from the color palette
Press Done
Then your blank rows will now be highlighted red.
To Count the Blank rows:
Choose an used column.
Enter the expression =if(countblank($H1:$J1)=3,1,0) in Row1 and auto fill as many rows as needed.
Total at bottom and use this value for you subtraction.
There may be easier ways but =if(countblank($H1:$J1)=3,1,0) will put a 1 in the row if H1:J1 are all blank.
I am usually good with conditional formatting in excel/google sheets, but here is my current challenge. I am needing to format specific cells based on the data in a table at the top of the sheet where the row used for comparison changes based on the value in one cell. Here is the link to the sheet I am currently working on.
https://docs.google.com/spreadsheets/d/1t7pgvGjxs1Eb3cCcRnLDA6E9ov5riEDAjn-fX3A0s8I/edit?usp=sharing
-The table at the top of the is the reference table and does not change.
-the number in column E is the data that determines which row of the table to compare the data in columns G through AN
The Situation:
Let's look at Name 3.
The numbers in G18:AN18 are compared to the G12:AN12 because of the matching number in E18 and E12
If the number in G18 equals G12 - no formatting change
If the number in G18 is one less than G12 - fill color Yellow
If the number in G18 is more than one less than G12 - fill color Red
This is true for each cell in row 18 columns G:AN
- That's the easy part -
Now, when the number in E18 changes (from "9" to "10" for example), I need it to stop looking at row 12 and now look at row 13 because E18 now matches E13
I know that I can do it using nested IF/AND statements but I would have to do it for each and every cell individually. How can I do this more easily through google sheets?
You need to use INDEX/MATCH, so for the yellow formatting starting in G16:-
=G16=INDEX($G$4:$R$14,MATCH($E16,$E$4:$E$14,0),COLUMN(A:A))-1
The idea is that as you copy it across the column changes to B:B etc. so you get the next column of the top region and as you copy it down you get whichever row matches E16, E17 etc.
I'm sure you can modify it for the red formatting and also to take account of any blank cells.
Also, in this particular case that the numbers in E4:E14 are just the numbers 1-11, you could use E16:E25 to index directly into G4:R14 and make the formula a lot simpler like this:-
=G16=INDEX($G$4:$R$14,$E16,COLUMN(A:A))-1
I have a row of values (say 1-10)
At the beginning of the rows I have 2 numbers generated from dates from other cells that represent week numbers. (eg, 3 and 9)
I want my row to highlight all the numbers from 1-10 that are between the values from the week number cells. (eg the cells with numbers 3,4,5,6,7,8 and 9 will automatically turn a colour (say green))
I've tried the conditional format, using the "between" values.
It doesn't work.
If I just type the numbers into the format box, it will work, but the problem is I need it to refer to the value in the cell NOT a number I type in, because there is a likelihood that the dates could change, which will affect the value shown in week number cell, so I need it to work automatically and not require me to go through every single row changing values for the formatting.
Is this even possible on sheets?
Thanks in advance, I am hoping I've just overlooked something simple.
Use a custom function for conditional formatting. For instance, if the columns you describe are in Row 2, this function will evaluate "TRUE" for numbers that are >= A2 and <= B2:
=AND(C2>=$A2,C2<=$B2)
Select the range of cells you wish to create a conditional format for; C2..L2, say. Open the conditional formatting dialog, and choose "Custom formula". Enter the formula above; note that itr refers to the top-left corner of the range you wish to apply the formula to - Sheets will automatically adjust it for the rest of the range, which is why it's important to use absolute references for the first two columns.
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