I have the data shown in image, Now I want to have Red Colour of the row in which the "Effect" column has negative value and Green for the positive value. Please help me out!
Data is enter image description here
Select columns A,B,C
For red
=$C1<0
for green
=$C1>0
Related
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.
I have 2 columns. I want to change the color of column B based on selected text in column A.
for example:-
If I select a specific text in column A that is "ABC" or "CBD" or "EFG".
value in column B should not be less than 0, if the value is less than 0 than format the cell with color red and if it more than 0 than color it with green.
I have been trying it with conditional format, but eventually its not working it out.
Your question is confusing. First you say you want to change the color of 'Column B' based on the text value, then you say you want to change the color based on whether the number is greater than or less than 0 but you didn't say what column these numbers were in.
I made a sample that will change the color of 'Column B' to either red or green based on the value of that number. But if you want to change the color of a cell based on the text value then you will have to create a rule for each of the text values you are dealing with then assign it to whatever cells you wish to affect.
If you could clarify the question for us a little, we could probably help you out with a more accurate solution.
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.
I don't know much about Excel and I'm trying to do the following:
So, if a I had column A and column B:
A B
red green
red green
red green
blue pink
blue pink
blue pink
blue pink
black white
black white
Let's say I have hundreds of rows of combinations. What I need to do is on a second sheet, show all the different combinations and the number of times each occurs. So for the above, the result would be:
Combination: Number of times:
red green 3
blue pink 4
black white 2
So, I would need to give me the combination and the number of times it occurs.
Any idea how I could do this?
Make a header into your spreadsheet: A1 = color1, B1 = color2, C1 = combination
1- Type on C2
=A2&"-"&B2
drag the formula down on column C until the last row in which there are data on columns A and B.
2- Go to "Insert" --> "PivotTable"
Drag "combination" into the "Row Labels", and Drag "combinations" into the "Values" label.
You need to have a mathematical operation in the pivot-table "Values" field, and the "Count" operation is already set automatically when one drags a variable into it (so, it should appear "Count of combinations").
Here is a screenshot about how the Pivot Table should look like:
One way you could do this is the following:
Select the entire data, copy it and paste it where you want to calculate the number of occurences. Select that range and in the Data tab select Remove Duplicates. This will get you all unique occurences of patterns.
Now, with the following formula you can get the count of each of those cases. Notice that this is an array formula so when you enter it initially you have to hit Ctrl+Shift+Enter in the formula box for it to calculate properly. Here's the formula, just change the cells to those that match your need:
=SUM(IF($A$1:$A$4&$B$1:$B$4=A1&B1,1,0))
Here,$A$1:$A$4&$B$1:$B$4 concatenates the two columns together to create "keys". It then matches this with the current combination to check (A1&B1) and then returns 0 or 1 and sums the total to get the count.
Add a third column - "Count" - adding the value "1" in each row of this column.
Include this column in your Pivot Table data and then allocate your fields in the Pivot Table as follows:
Columns: A | Rows: B | Values: Count