Conditional formatting based on value on left cell - excel

I'm doing a sales sheet presentation and need to show in colours how that client did based entirely on his previous months' purchases, green for better, red for worse.
Example:
How can I do this with conditional formatting?

In the CF crete new rule, choose Use formula... in rule type and
use =C2<B2 formula for red cells and =C2>B2 for green cells.

Related

Excel conditional formatting: color based on comparison of values in a row

how can one format the color of cells according to their values in that row? In this table, I want to give red for the most expensive carrier, green for the cheapest one and orange fro the middle range one, for each row:
After conditional formatting, it should look like this:
Thank you!
Apply Graded Color Scale conditional formatting, but set the Applies to range to =$B$2,$E$2:$F$2
Then use format painter to copy this conditional formatting to the rows below. You'll end up with a separate rule for each row:
Format your colors to suit.
Another way with just two rules is to 'standard' fill with orange as much of ColumnsB, E and F as required, select and clear any CF rules from B:F then HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(B1=MAX($B1,$E1,$F1),B1<>"")
Format..., select red Fill, OK, OK.
Add another formula rule of:
=AND(B1=MIN($B1,$E1,$F1),B1<>"")
with green Fill.
Select ColumnD and Clear Rules from Selected Cells.
In case of ties green will have precedence, unless the rule order is reversed.

Copy conditional formatting to other columns on a spreadsheet that are not grouped together

I have created conditional formatting in a date column to show red if it's expired, orange if it's 30 days out from expiring. My boss now wants me to apply this to every register/database that exists. Problem is that some of the worksheets have multiple date columns and are not one after the other.
I haven't worked out how to copy and/or past the conditional formatting to the other date columns on the worksheets without redoing the conditional formatting from scratch.
Any solutions?
Assuming this is for Excel and you are dealing with entire columns then I suggest starting again (so we know what formulae are in use and that the Applies to range is a complete column) with, say for ColumnA, HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(A1<>"",A1<TODAY()+30)
Format..., select orange, OK, OK.
Then repeat for red with:
=AND(A1<>"",A1<TODAY())
If these suit for ColumnA you should then be able to pick any one of the conditionally formatted cells, click Format Painter then, select whichever other columns you wish the rules to apply to.
Note that the order in which these rules are applied is significant. In Conditional Formatting Rules Manager red should be above orange (their order may be changed with the up/down arrows) and I'd suggest for red checking Stop If True).

Automatically apply fill colour conditional upon row by row comparison of two columns

I have two Excel columns of numerical natural values and of the same length.
For each row I would like to fill the cells with red if the values are different, with green if they are equal.
I thought I could do this using Conditional Formatting but it seems it is not fit to compare two columns.
Am I wrong? How can I do that? How to use an IF statement for this?
Assuming the values are in column A and B
To create the first rule:
Select columns A an B. Do this by dragging from column header A to
B.
Then, click Home > Conditional Formatting > New Rule.
In the New Formatting Rule dialog box, click Use a formula to
determine which cells to format.
Under Format values where this formula is true, type the formula:
=$A1=$B1
Click Format.
Select a green fill color.
Click OK until the dialog boxes are closed.
The formatting is applied to column A and B.
Now you can create a second rule for =$A1<>$B1 with red fill color.
A "cheat" (if your columns are not too long) is to transpose your two columns, then use CF's Highlight Cells Duplicate Values rule (but change the default colours to suit) and transpose back again. It may be a slight advantage of this transposition that formatting will not be applied to cells in the same row that are both blank (though easy enough to arrange for this with a formula rule).
The point of my answering however is really to say that you only need one rule. Since every cell is going to be either red or green using standard formatting for one format is sufficient. For example, fill your entire data set with 'standard' green fill and then apply a formula rule for red. This will happily override the 'standard' green fill where appropriate.
If applied to Range $A:$B (such as by first selecting ColumnsA:B) I suggest a formula rule of:
=AND(A1<>"",$A1=$B1)
You do not need an IF statement because the formatting is conditional (the IF is implicit).
Assuming your data is in columns A and B, first select the column you want to colorize.
Then for the green :
Conditionnal Formatting > New Rule > Use Formula to determine... > type formula : =(A1=B2)
Then Click the Format... button and choose Green color
And for the red :
Conditionnal Formatting > New Rule > Use Formula to determine... > type formula : =(A1<>B2)
Then Click the Format... button and choose Red color

How to do color formatting of cell in excel based on multiple conditions

I have two columns. One column has the tier as Prime,essential,maintenance and Consumption.
Other column has values in either % or as NA.
I want to format all cells which are having tier as Prime and essential and value is >=90 as green else Red.
Similarly if tier is maintenance or Consumption and value is >= 96 then green else Red .
How do i do it.
Please help
Select the range that you will work with;
Click the Home > Conditional Formatting > New Rule….
In the Format Only Cells with section, specify the conditions that you need.
Click the Format button.
In the Format Cells dialog box, set the background color under Fill tab.
More details here
For your conditional formatting just select a column go to:
conditional formatting>highlight cells rules>less than at the value you put 90 and at highlight you choose red
then again:
conditional formatting>highlight cells rules>greater than and at the value you put 89 and at color green
UPDATE:
For more conditions go to new rule and choose use a formula. The formula will look like this for the green color: =AND(A1="Prime",B1>90) then you do the same steps for the other conditions and colors.
As I understand it, all cells will be one or other colour, which means only one colour need be set by Conditional Formatting. (The other can be applied with 'standard' fill, leaving the CF rule to override it where applicable).
It might be easier to fill 'standard' with green and use CF for red but the formula rule for green (ie formatting the whole range red with standard fill) might be:
=OR(AND(OR($A1="Prime",$A1="essential"),$B1>=0.9,NOT(ISTEXT($B1))),AND(OR($A1="maintenance",$A1="Consumption"),$B1>=0.96,NOT(ISTEXT($B1))))
This assumes the tiers are in ColumnA and the percentages are in ColumnB (where the value 1 represents 100%, even if formatted to appear as 100%). The Applies to range should be =$A:$B or a number of rows in those columns, to suit. The Applies to range may be set by selecting ColumnsA:B before entering the CF formula rule.

Excel Formatting Cell Conditions

I have some large tables of data for percentages of employees in different areas with degrees for each month for the past year, I want to add a conditional format that highlights a cell green if the number increased from the previous month and red if it decreased. I know how to do this individually but I was wondering if there was a larger scale method to do this?
The following assumes that the data is formatted such that the percentages of employees are all in the same row and the successive months are in consecutive columns.
Here's how I have my sheet set up:
What you can do to acquire the red/green formatting is highlight C2:M2, click Conditional Formatting under the Home ribbon, then select New Rule. Next, click "Use a formula to determine which cells to format" and in the formula bar write the following:
=IF(C2 > B2, 1, 0)
Now click Format and go to the Fill tab. Select any shade of green that you want and press OK. Press OK once again on the Rule window and that "greater than" rule will be created. Do the same thing but instead enter this formula
=IF(C2 < B2, 1, 0)
and select a shade of red and you should be good to go.
A possibility you did not mention is that cells that have not changed in value from one month to the next should be neither red nor green. That is still possible with just two rules if coupled with a default fill set as ‘standard’ fill rather than with conditional formatting, say red:
Select the range to be formatted, say C2:M100, and apply a ‘standard' fill of red colour. B2 is assumed to be a datapoint but since without precedent is not to be formatted.
Overwrite this with a conditional formatting rule using a formula to determine which cells to format such as:
=C2>B2
and select green fill.
Add a second rule of:
=C2=B2
and select white fill.
Since the rules are mutually exclusive, might as well check Stop If True for both.
There is no need for =IF(…,1,0) since this is Conditional Formatting and the IF is implied.
If you wanted say a traffic light analogy, with amber for ‘no change’, use a ‘standard’ amber fill for B2:M100, select C2 and apply:
=C2>B2
as above and select green fill but change the second rule to:
=C2<B2
and select red fill.
Ensure that the Applies to range for both the above is =$C$2:$M$100 (this just being an alternative to starting by selecting C2 rather than the entire applicable range).

Resources