Conditional Formatting cells based on how many times it appears in separate Column - google-sheets

https://docs.google.com/spreadsheets/d/12TsEEj3LQSIOv2m6LRRS6FCLvIkuUo_ECfQvK4gw4d8/edit?usp=sharing
I want to use conditional formatting to count the amount of times a name appears in Column H and make the corresponding name in Column B red if it shows up once and crossed out if it shows up twice.
How can I do this? I used COUNTIF but I don't know how to attach the formatting to a specific name/string in Column B so it just formats the next one on the list (I think).
Any advice or help would be greatly appreciated.

Clear any conditional formatting from ColumnB, select B3 to the end of your range to format and Format, Conditional formatting..., Format cells if... Custom formula is and
=countif(H:H,B3)=2
with strikethrough. Add another rule (same range) with Custom formula is and
=countif(H:H,B3)=1
with red fill and Done.

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 conditional format each row of a column based on corresponding value in another column

Please refer the image
I want the cell to be highlighted based on the value is less than or greater than the value in the benchmark column. I am not able to do that using conditional formatting custom formula. I have manually applied formatting for 02/01/2023 . I want the formatting to apply to the column with date = today() only.
Thanks :)
I can write a custom formula for each row of each date column. But is there any way a single custom formula that could format across rows and columns?
I'm guessing your fist value of 02/01/2023 and Activity1 is C2. Then for the whole range C2:Z (or whichever you have):
=C2>=$B2
Do this for one color for the whole range and it will drag automatically, you don't need to write it as an arrayformula. The "$" will always refer to the value in column B from the row it's positioned
if you are selecting whole range (C2:Z), try this for green and red respectively:
=(C2>=$B2)*(C2<>"")
=(C2<$B2)*(C2<>"")

Value contains many text in Conditional Format Rules Google Sheet

I want to set conditional format rules in my Google spreadsheet. For the format cell, I select "Text contains", then I type values "PA, MA, CT, NY", formatting style I choose red. When I click DONE, the columns containing these words didn't show the color. I don't want to create rules "PA', "MA", "CT"and "NY" one by one. How can I fix them? Thanks for helping.
Select the relevant range (I am assuming starts at A1) and clear any existing CF rules from it. Format, Conditional formatting..., Format cells if... Custom formula is and:
=regexmatch(A1,"PA|MA|CT|NY")
with red fill and Done.
This should format any cells that contain any of the four state abbreviations (that is, both as part of the content of a cell and as all the content of the cell). It should format PACT but being case sensitive not many.
Try using OR with custom formula like this:
=or($A2="PA",$A2="MA",$A2="CT",$A2="NY")
As Ed said, but to clarify,
Go to conditional format and select 'Custom formula'
Assuming that your values are in column A, set the range to A1:A and enter the formula =OR($A:A="PA",$A:A="MA",$A:A="CT",$A:A="NY") in the custom formula field.
If the values are not in column A then change the formula as necessary.

Change the background of one google sheets column based on the date in another column

I've seen lots of answers for various other conditions under which to do this. However I can't seem to modify any of these to work for a date range. What I want is for the column color of column E to change if the date in column H is between today and 5 days from today.
I've tried varying versions of this formula: H3:H150 =today() +5 with no success
This doesn't give me the range of between now and 5 days from now but I could do multiple rules like this and just go down on each one(=today() +4, =today() +3, etc) but obviously I need this rule to work first.
Thanks!
Conditional formatting is more helpful than you seem to be expecting. Clear formatting from the column to be formatted, select it and Format, Conditional formatting..., Format cells if... Custom formula is and:
=and(H1>today(),H1<today()+6,H1<>"")
Then select fill of choice and Done.
This should format the next five days (change the angled brackets around for the past five days).
Setting the range is achieved with selection of the column to be formatted (not the one with dates in it - H). If only to apply to Rows3:150 (and in general it is a good idea, for speed of processing, to restrict the ranges to which CF is applied) then either start by selecting Rows3:150 in the column to be formatted (instead of the entire column) or adjust the Apply to range for the rule, but in either case use H3 in place of H1 in the formula above.
CF should automatically apply the rule as written to the first row in the selected range and then adjust it for the second and subsequent rows in the way copying down would adjust the formula (if at all) were it in a cell in the sheet.

Conditional Formatting from another sheet

I'm trying to have a cell on Sheet A check if it's either > or < the value in a cell on Sheet B, then change its color accordingly. Under the custom formula I use: =A1>("SheetB!A1"), but it doesn't seem to work. I use the color Green for the > and the color Red for the <. Every time the rules are saved it will always display A1 on Sheet A in red.
Is the function wrong? Or is it not possible to have a Conditional Format even search across sheets?
For some reason (I confess I don't really know why) a custom formula in conditional formatting does not directly support cross-sheet references.
But cross-sheet references are supported INDIRECT-ly:
=A1>INDIRECT("SheetB!A1")
or if you want to compare A1:B10 on SheetA with A1:B10 on SheetB, then use:
=A1>INDIRECT("SheetB!A1:B10")
=A1>INDIRECT("SheetB!"&CELL("address",A1))
applied to range A1:B10.
You can do this by referencing the cell and row number in the current sheet, so as you drag-copy that conditional formatting to other rows it will reference the correct cells.
In the below equation I am coloring cells based on the exact same cell in some other sheet named "otherSheetName" in this example. If for example you want to color cell B2 in Sheet2 if the cell B2 in otherSheetName contains the text "I Like Dogs" you would go to cell Sheet2!B2 , click condition formatting, choose equation from the drop down and paste the below equation.
=IF(INDIRECT("otherSheetName!"&ADDRESS(ROW();COLUMN()))="I Like Dogs";1;0)
Comparing strings instead of numbers for a conditional formatting rule, you can use:
=EXACT(A1,(INDIRECT("Sheet2!A1")))
Case sensitive.
There is one trick/bug: if you have conditional formatting in Sheet1 that explicitly references itself (e.g., the formula is Sheet1!$C$2), you can copy the conditional formatting to Sheet2 with Paste special > conditional formatting and it will "work"... as long as you don't touch anything:
if you try to edit the conditional formatting in Sheet2, then you'll get an "Invalid formula" error.
if columns/rows change in Sheet1 such that they affect the conditional formatting (e.g., row/column inserts), this is not reflected in Sheet2 (keep in mind that the indirect trick mentioned by #AdamL will also not reflect column/row updates either, so it's a wash in this respect).
I was able to compare two sheet and highlight the differences on the second sheet using conditional formatting :
=A1<>(INDIRECT("Sheet1!"&Address(Row(),Column(),)))

Resources