I have a spreadsheet with a bunch of ID's that my community uses to track how many times a player has received a "restore". Currently I have conditional formatting setup to color the cell red if there is a duplicate. I want to get a bit more in depth with it though.
1 occurrence of the ID = No color change
2 occurrences of the ID = Cell red
3+ occurrences of the ID = all the duplicates go yellow background with red text, and if possible adds text 3 cells to the right of the duplicate saying "Third restore!"
Assuming data is in ColumnA, clear any CF from that column and please try selecting ColumnA and: HOME > Styles, Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: of:
=COUNTIF(A$1:A1,A1)=2
with red highlighting. OK. Then add a second formula rule of:
=COUNTIF(A:A,A1)>2
with yellow highlighting and red font.
Related
Suppose that I have following data
I want to perform conditional formatting in cells containing Y. For example if I select the cell Shirts I want all the cells where Shirts is Y to be highlighted yellow. Similarly if I select cell Books I want all the cells where Books is Y to be highlighted green.
How can I achieve that?
Expected Output (Shirts Output)
I set some conditional formatting so if I enter "T" in one cell (Y3) then the selected cells (Y$:Y200) get formatted yellow with a border like so:
Just expand the formula to do what you need, perhaps and() to include "book" etc
And(y3="T",y4="Books")
as an example. Edit and test as you need.
In excel, I have the following:
I am trying to find the quickest and most user-friendly way to compare columns 2 and 1.
If a name in column 2 (in the format shown below) matches ANY of the cells in Column 1, the cell in Column 1 goes GREEN, indicating that user is PRESENT in Column 2.
I have played around with conditional formatting but would appreciate any direct and efficient solutions.
I was trying to adapt a version of this, but it failed to work:
=SUMPRODUCT(--(MID($A4&" "&$A4,FIND(",",$A4)+2,FIND(",",$A4&" "&$A4,FIND(",",$A4)+2)-FIND(",",$A4)-2)=$B$4:$B$33))
where the above formula was added on highlighting the first column and then ensuring the A4 referred to the first item in Column 1 and the B was the first and last item in column 2. As mentioned, this didn't work.
Update
Tried this as well but didn't work.
This answer written assuming column1 = column A, and column2 = column B
Apply a conditional format on column 1, set up with green background, with the formula =COUNTIF(B:B, A1)>0
Apply another conditional format on Column 1, set up with red background, formula =COUNTIF(B:B, A1)=0
Edit those formulas as necessary so that:
B:B is the address of column 2, the range you're looking in for each name
A1 is the address of the first (top-left) cell that the conditional format applies to.
You can select both columns and do Conditional Formatting, Highlight Cells, Duplicate Values. That would be the easiest way to compare. You can format the cells in the first list with red fill if you want them to be red and set the format for duplicate values with green fill. This will format it in the color scheme you showed. If the name is removed from the second column, the cell will go back to red.
I need the cells to change color based on the condition (blank = ) of a date being recorded in the prospective cells. Placing the first date in the Sent column turns RED, to YELLOW in Received and the all three turn GREEN when the date is filled in the Received column.
I am assuming the Sent column is F, the Received is G and the Distributed one is H. Also that these dates are filled consecutively, ie there won't be a Received without a Sent and so on. Please select the columns to which you want the formatting applied. Then HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=$F1<>""
Format..., red, OK, OK.
Repeat with for yellow:
=$G1<>""
and for green:
=$H1<>""
Note that if, as recommended, you have labelled your columns this will fill the labels green. If that is a problem either select a range that does not include Row1 and row references to suit, or adjust the formulae (say by wrapping in =AND(row()<>=1, ... ) specifically to exclude Row1, or add an additional rule for Row1 only (with no formatting set), or reduce the Applies to range.
Note also that the order in which the rules are applied may be important. This can be changed in the Conditional Formatting Rules Manager (green should be above yellow and yellow above red). The rules are applied in the reverse order I am expecting the dates to be entered. So if you opt for 'no formatting' for Row1 that should be above green with Stop If True checked, or at the bottom.
Let's say I have a row like this:
Grade Q1 Q2 Q3
? Green Red Green
The function for "Grade" (A2) needs to be as follows:
If 2 of 3 B2, B3, B4 (Q1, Q2, Q3) are color GREEN then Grade = PASS else Grade = FAIL
So, I need to check to see the color of Q1,Q2,Q3 and based on that put PASS or FAIL in GRADE cell. Any clues?
Thanks,
Try
=IF(COUNTIF(B2:B4,"green")>=2,"pass","fail")
This works when the cells have the text "Green" in them. It will not work if the cells have been colored with a fill color.
As a general rule: Color is not data. Many people run into problems when manually formatting cells with colors and then trying to aggregate this into information. Newer Excel versions have tools to filter and sort by format color in a table, but counting or summing by color is still not possible with Excel native formulas.
Instead of coloring cells, enter values. Enter the text values "Red" and "Green". Use conditional formatting to apply colors to cells based on their values. Then you can use formulas to aggregate (sum/count/average) by the cell values and still see the colors. The other benefit with conditional formatting is that the cell color changes immediately when the value changes from "Red" to "Green" for example.
There are two columns; the first contains four colored cells, while the second contains numbers. Is there any way to color the second column so that it matches the colors of the first column in the same order.
Eg. A1=Green, A2=Red, A3=Grey, A4=Black (COLORED).
B1=4, B2=3, B3=2, B4=1 (BLANK).
= A1=Green, A2=Red, A3=Grey, A4=Black (COLORED).
= B1=4 (Green), B2=3 (Red), B3=2 (Grey), B4=1 (Black) (COLORED).
Manually coloring the column will not work here because I want a cell in the second column to be able to match the cell next to it if its color changes. So for instance if a cell in column A changes from "black" to "red", I want the corresponding cell in column B to change from "black" to "red" automatically.
Eg. A1=Green, A2=Red, A3=Grey, A4=Red (COLORED).
B1=4 (Green), B2=3 (Red), B3=2 (Grey), B4=1 (Black) (COLORED).
Here A4 is now "red", while B4 is still "black". I want it so that if A4 changes color, B4 will change color to match A4.
I tried experimenting with conditional formatting, but that doesn't seem to be working out so far, would there be a formula for something like this, or am I SOL?
This is possible using Conditional Formatting.
You would have to select both columns and then choose to use a formula for the conditional formatting.
There you would input
=$A1="Red"
and set the formatting to red.
The $ fixes the formula to the first column. If you omit it, only column A would be colored in.
That way you would have to write the cell background color in column A, and if you set the font color to the same value you won't see it...
Another option would be to use a VBA macro, that runs on every SheetChange Event that will copy the background color from column A to column B
Edit:
As #lowak pointed out, you will have to create one rule for each color.