Conditional formatting of rows alternating at 4 rows at a time? - google-sheets

For example, row 1-4 would have red background, row 5-9 would be blue, then 10-13 would be back to red, etc
all the tutorial I found only covers alternating each row.

you can use MOD of 8 rows 4 times while each time you offset it by one row like:
=NOT(MOD(ROW(A1:A), 8))

I suggest
=mod(row()-1,8)>3
with a default fill colour of red.

Related

Adding number to multiple cells in google sheets - without dragging corner or copying background color

I've tried to figure out multiple ways to do this. It seems like it should be simple enough but I haven't been able to figure out how to select multiple cells to fill them with the same number - without changing a preexisting background color that I have across some cells.
If I do the usual select the cell, drag the corner routine, I end up copying the background color in unintentional ways.
I literally just need the same number (.25) assigned to almost every cell.
try:
=INDEX(SEQUENCE(5; 6; 1; 1)*0.25)
where 5 is row and 6 is column
Use this formula
=ArrayFormula(IF(ISNUMBER(RANDARRAY(COUNTA(A:A),COUNTA(1:1))), 0.25, ""))
Explanation
COUNTA(A:A) is the number of columns in the range A:A.
COUNTA(1:1) is the number of rows in the range 1:1 the "header".
You can replace it with hard coded number
Example: 12 columns and 10 rows.
=ArrayFormula(IF(ISNUMBER(RANDARRAY(12,10)), 0.25, ""))

How to change the cell colors of a column according to the cell's value distance to the column average?

I am building a spreadsheet with a column with values that I would like to create a more visual way to identify discrepancies. So I would like to change the colors of the cells in a column according to the distance from the cell value to the column average.
For example, in this column I have the following values:
8
14
1
12
6
19
Their average is 10, I would like the cells to automatically have the colors:
8 (lighter red)
14 (green)
1 (darker red)
12 (lighter green)
6 (red)
19 (darker green)
I thought about averaging this column in a cell and putting color conditional formatting for values larger and smaller than this column mean. But in this case, my cells would have only two colors: red for below-average values and green for above-average values. Is there any way to change the color of these columns according to the discrepancy with the average of that column? Thanks in advance.
in Google Sheets it's like this:
You can use Color Scales in Conditional Formatting for this: Select a New Rule With your Desired colors for Minimum & Maximum Value
Result:
Same Goes if you are using Google Sheets. Goto Format>Conditional Formatting> Color Scales
Assuming you have excel 2016 or newer, simply highlight the data you want to have included, and then click Conditional Formatting (from the "Home" ribbon), then click "Color Scales" and pick the desired one.
After setting the color scale, you can then modify it by selecting the same data, and then clicking "modify rules". What you've stated is a 2-color scale, and that is one of the options you can choose if you go back and edit the rules.

Using conditional formatting to shade alternating groups of cells of variable size

I am facing an issue where I need to shade a row of cells either blue or orange based on if the user has check-marked the "swap" cell.
Essentially, the rows will start blue and continue to be blue.
When the user presses the checkmark in the Swap column, all rows after that point will now be orange.
Once again, if the user presses the checkmark in the Swap column (below the above checkmarks), the rows will go back to being blue from that point on.
This will alternate forever, as demonstrated in this image.
I am using some conditional formatting code that uses a "helper" column that is hidden. If the value is 1, then the row is coloured orange. If the value is 0, it is coloured blue. The problem is I don't know how to "search" for groups of checkmarks. Each checkmark will only colour the individual row it is in.
The helper column has this code: =MOD(IF(ROW()=2,0,IF(D25=D24,E24, E24+1)), 2)
The D column is where the checkmarks are, and begins at D24.
The E column is my helper column and begins at E24.
I can scrap this whole setup if someone can guide me into how to set this up.
I need it to essentially "change" the values of every row below a checkmark, until it finds another checkmark, and do the reverse so that the colouring can properly format.
Assuming 0:00 is in A1, please select ColumnsA:C and: (i) fill all with 'standard' fill blue and (ii) Format > Conditional formatting..., Format cells if... Custom formula is and:
=isodd(COUNTIF($C$1:$C1,TRUE))
with brown highlighting.

conditional formatting for a full column based on the average value in that row?

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).

If any number in one range of cells matches a number in another range of cells, highlight them?

I am trying to find a formula for conditional formatting a specific range of cells.
Screenshot
If any number in the yellow cells (B1:K20) matches any number in the green cells (N1:S30), highlight that number in the yellow cells with a background color. There are and will be duplicates in both the yellow and green cells. I made the cells yellow and green to make it easier to explain my problem, normally they are all blank where the highlighted numbers in B1:K20 will have a green background. Numbers range from 1 to 45.
I used to do this by making a new rule in conditional formatting for every unique number in the green cells but that is becoming very tedious as the amount of numbers in the green cells grow larger.
I have experimented for a couple hours with the MATCH formula in conditional formatting but have gotten very odd results, hoping any of the experts here could help.
Please select B1:K20 and try a CF formula rule of:
=countif(sort(unique(query({$N$1:$N$20;$O$1:$O$20;$P$1:$P$20;$Q$1:$Q$20;$R$1:$R$20;$S$1:$S$20}))),B1)
BEWARE This seems unreliable (or just plain wrong?!)
It seems the response lag for changes might be reduced with the array outside the CF formula, so perhaps in say U1:
=sort(unique(query({$N$1:$N$20;$O$1:$O$20;$P$1:$P$20;$Q$1:$Q$20;$R$1:$R$20;$S$1:$S$20})))
and instead for CF:
=countif($U$1:$U$120,B1)

Resources