I'm looking to limit the number of cells that can have the same value in a column.
More precisely, I'm keeping track of people signed up for meeting dates and once four other people are assigned that date, it not to be an option anymore or highlight the cell in red? Something to alert that the meeting is already full.
Thanks in advance for any help or advice.
If highlighting the cell in red would be enough, then you can use this custom formula in your Conditional Format Rules.
Apply to range = A1:A
Custom Formula:
=countif(A:A,A1)>=4
What it does?
Increment a counter if duplicates are found in the given range using COUNTIF()
If the number of duplicates are >= 4 then set the background color of the cell to red
Sample:
Another variation if you have a different list of available dates to highlight and a list of booked dates
Apply to range = A1:A
Conditional Formatting Custom Formula:
=countif(C:C,A1)>=4
Highlighting of cells will only be applicable in Column A. It will check how many duplicates data in Column A exist in Column C using COUNTIF()
Related
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<>"")
I'm relatively new to using google sheets and formulas and what not.
I am trying to highlight a row of cells using conditional formatting based on whether or not a name and date are both present in another range of cells.
In the case of the names, I need an exact match which I have figured out already easily enough.
In the case of the dates, I need it to highlight only if the leftDate is less than(prior) or equal to the rightDate displayed in another range of cells.
For example,
Names and Dates
In the left section of the sheet, the row containing Jacob should be highlighted due to his name being present in the right section of the sheet AND the date being prior.
Where as Nicks row in the left section of the sheet would not be highlighted due to the date being after.
Andrews row on the left would be highlighted due to having the same date.
Mikes row would not due to his name not being present on the right section.
so far for comparing the names I am using a COUNTIF function, and to enable both names and dates to function I have it nested in an AND function, like so
=AND(COUNTIF(leftNames = rightNames),COUNTIF(leftDates>=rightDates in relation to name))
The name portion works it is the date portion I am struggling with, sorry for the long winded explanation. Any help is appreciated!
Thanks
try for range A3:D:
=INDEX(IF($B3<VLOOKUP($A3, $F$3:$G, 2, 0), 1,
MATCH($A3&$B3, $F$3:$F&$G$3:$G, 0)))
I built a Google Spreadsheets tracking the price of certain items in each month. The different items are displayed in row 3:30. Different retailers are displays in Column C:M. Each month is displayed in a different sheet. I want to match (for example) Cell C3 to Cell C3 in the month before and color Red if the price has increased, Green if the price has decreased and remain white if the price is the same. I want to do so for each of the cells C3:M30.
I have managed to find a formula to match cell C3 to C3 then cell C4 to C4 etc. untill cell C30. This is the formula I used:
=C3>INDIRECT("OKTOBER 2020!C"&ROW())
This works fine for Column C, but I can't find a way to incorporate Columns D:M in this formula. Is there a way to incorporate the conditional formatting rule for Columns D:M in the same formula? Or should I just add this formula to each row with the corresponding row Letter?
Answer:
You can do this with an ARRAYFORMULA.
Formula:
=ARRAYFORMULA(C3:M30>INDIRECT("OKTOBER 2020!"&SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","")&ROW()))
Rundown of this formula:
Creates an ADDRESS of a cell which has a row of 1, the current column index, using a relative reference.
Substitute the hard-coded row number 1 to extract out the column letter
Construct an indirect reference to the current cell using the extracted column letter, the current ROW(), and appending it to the string OKTOBER 2020!
Check if this cell is greater than the current cell
Run this whole formula on the range C3:M30. This can be expanded to cover additional cells, if necessary.
This formula checks if the price has gone up, for which the conditional formatting should reflect as such. You can also do this for when the price has decreased or stayed the same by changing the initial comparison operator:
Price decrease:
=ARRAYFORMULA(C3:M30<INDIRECT("OKTOBER 2020!"&SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","")&ROW()))
No price change:
=ARRAYFORMULA(C3:M30=INDIRECT("OKTOBER 2020!"&SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","")&ROW()))
References:
ARRAYFORMULA - Docs Editors Help
INDIRECT - Docs Editors Help
SUBSTITUTE - Docs Editors Help
ADDRESS - Docs Editors Help
COLUMN - Docs Editors Help
ROW - Docs Editors Help
I would like to highlight every row where the numbers in Columns F and G match. This works perfectly, with text (a-z), as answered in this thread:
Google Sheets Conditional Formatting based on two cells
But, I am not sure how to make it work when it's a number. Any advice appreciated!
Apply custom-formula conditional formatting of =$F1=$G1 to the whole range you wish to affect.
Change the 1's to the row number that is the first row in your selected range. E.g. If applying to A5:H, the formula would be =$F5=$G5.
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.