Colour scale based on how far value is from other cell value - excel

I have a column of targets (C2:C30) and a column of projections (D2:D30).
I've been able to conditionally format the projections to highlight values either above or below target, but I want to expand this into a colour scale to be able to identify more quickly how far from the target my projection is.
For example, if D:D is above 90% of C:C, a green colouring would suffice. 80-90% would be amber, below 80% would be red. In an ideal world, a fully fledged colour scale would be great but at this moment in time I'll be happy with anything more sophisticated than my current above/below setup.
I believe I could use a series of stacked conditional formats but thought there might be a more efficient way of doing this?

You can create your own scale,
Create first rule using something like:
=C2*1.9<D2
Apply this in Cell D2, then apply to D2:D30,
Then create second rule:
=C2*1.8<D2
And so on..

Related

Apply Conditional Formatting based on proximity to a list of multiple different values

I have two columns of numbers that are calculated values for two different capacitors that I will be using in a circuit. I would like to highlight entries that are close to a list of standard capacitor values.
Is there a good way to do this?
Here is a screenshot of a small portion of data that I have to go off of:
You can try CF with following formula:
=OR(ABS(A1/TRANSPOSE($F$2:$F$12)-1)<=$G$2)
I’m assuming you’re asking “are any of the C1 or C2 close to any of the standard values listed”
With that assumption, I would do it this way:
Create some “calculation rows” away from the raw data. For each C1(or C2) value, make a column of =(C1-standard value)/C1 then apply the conditional formatting on that. If any of them get close enough, say 5%, then make it green.
You’ll have a big 2D grid (every C1 or C2) vs (every standard value). It should be easy to see if any pop out green!

Alternating Color of Rows with Merged Rows in Leading Column - Excel 2016

I'm trying to create an Excel sheet that will be tracking some of our autonomous processes and their access privileges at my company and I've run into an issue with Excel..
I'm trying to alternate row colors, which in and of itself isn't an issue, however the fact that I've got merged rows are giving me issues.
As of right now I've got 5 columns with headers in A through E. Column F is being used for conditional formatting to color the rows. In column F this formula is present:
=MOD(IF(ROW()=2,0,IF(A2=A1,F1, F1+1)), 2)
This works great if I want to repeat the leading Column item over and over, however I'd like to reduce the visual clutter and increase clarity, so I've merged some of the rows in the Column A because multiple rows in B:E correspond to it.
I've merged A2:A4 right now and the formula picks up the A2 and A4 as blank, but A3 (the text in the merged cell is centered) is recognized as different that A2 and A4 because the text resides there. I'll upload an image to give a better idea of what I'm talking about as well.
If anyone can give me a tip on how to alternate row colors with merged cells/rows that'd be great, I've done a lot of googling and searching on stackoverflow, but for the most part I've only found things that pertain to unmerged rows/cells.
Image Example: https://imgur.com/a/UDbRVWA
=IF() Condition that worked for me:
=MOD(IF(ROW()=2,0,IF((A2=0),IF((OR(A1<>0,A2=A1)),F1, F1+1),F1+1)), 2)
There is an answer below with a picture I posted, however, for most situations I would recommend the method suggested by #BruceWayne. It's far more sensible than working with merged cells!
I ended up finding a solution with just some clever working with the Conditional IF() statements. I think the key was taking into account that the Merged Cells that weren't the top (i.e. If I merged A2:A4, A2 is top, A3, A4 bottom) were equal to 0 while the top was set to the value of the text within the merged cell. Using the formula below I was able to achieve the result I was after:
=MOD(IF(ROW()=2,0,IF((A2=0),IF((OR(A1<>0,A2=A1)),F1, F1+1),F1+1)), 2)
And here is a linked screenshot: https://imgur.com/a/gNaC62c
I then just added conditional formatting for every row but row 1: =$F2=1. I'll be hiding column F to make it seem less obtrusive.
For future reference, I would agree with what #BruceWayne mentioned in that a simpler formatting that gets the job done would be preferable. There are many other ways to format this in a way that makes much more sense, but I felt like I was close when I was tinkering with it, so I stuck with it another 15 minutes or so and was able to pull out a usable formatting condition.
Might I make a suggestion? If the merging rows is to increase clarity with repeated entries, perhaps we can use another Conditional Formatting rule to make it more legible.
Say you have data that looks like this:
But, we don't want to see <Process #> duplicates in the A column. We could merge these cells and center it along the rows. But again, merging cells is generally frowned upon I've found. (It makes it tricky to format, conditional format, copy/paste, do any VLOOKUP()/Index/Match, etc.)
First, let's get the rows alternating colors. I'm using fill of RGB(183, 255, 253):
New Rule 1 -
Formula: =MOD(ROW(),2)
Applies To Range: $A$2:$E$9
Format: Fill with color RGB 183, 255, 253 (...or whatever you want, just note the RGB for later)
Now, we get this:
Okay, making progress. Now, let's work on hiding the duplicate values in column A.
So, let's apply some more Conditional Formats. We'll need two for column A, one to set the font to White, one to set the Font to that blue fill color.
New Rule 2 -
Formula: =AND($A3=$A2,MOD(ROW(),2)=1)
Applies To: =$A$3:$A$100
Format: Font --> Color --> RGB(183, 255, 253)
New Rule 3 -
Formula: =AND($A3=$A2,MOD(ROW(),2)=0)
Applies To: =$A$3:$A$100
Format: Font --> Color --> White
Now we have:
IMO, we can do one more thing to clarify the breaks in Processes:
New Rule 4 -
Formula: =$A2<>$A1
Applies To: =$A$2:$E$100
Format: Border --> Top Border
Now, we have a nice new CF table.

Complex Conditional Formatting Scenario

Thank you in advance for whatever help you may be able to provide.
Purpose/Scope
Analyzing the effectiveness of retail store renovations and relocations.
Existing Material
I have many slices or views, but let's assume there is only one.
The back-end looks like this. Please note that empty cells will still have a formula in them as they are being populated from a data dump.
Back-End
The front-end looks like this and is populated with an 'Averageifs' formula, simplified example is below. "CompStores" is a named data range.
=IFERROR(AVERAGEIFS(CompStores[Growth Year 2],CompStores[Action],$A1),"")
Front-End
Just for clarity, the counting table (if needed) would look like this. Hopefully this project will not need a counting table, especially considering switching "averageifs" to "countifs" cannot easily be done by a search+replace because countifs has less arguments.
Counts
The Task
• Highlight each cell in the front-end based on how many observations there are with the purpose of knowing how confident we are in that growth %.
• The counting system I would like to use in real life is under 5 observations = red, 5 to 9 = yellow, 10 or above = green.
Here is an example output based on the count and colours I will use in real life.
Sample Output
Please help me, I really don't want to have to do this by hand lol. Thanks to anyone who even attempts to help!!!
Whenever I have several conditions for conditional formatting, I always prefer to non-conditionally (permanently) format the cells with the most complicated condition and then use subsequent conditional formatting rules to "override" the base formatting.
In this case, since yellow is the most complicated condition (since yellow falls within a range and has two bounds, as opposed to red and green which just have a single bound), I permanently formatted the entire range (B2:E3) as yellow and then made two conditional formatting rules (one for red and one for green) to override the yellow base formatting.
See below screenshots of simplified versions of your data.

Excel 2016: Adding Gradient Formats for Cell Background and Font?

I'm using Microsoft Excel 2016 to construct a forecast model with a range of outputs. I have used Excel's built-in Conditional Formatting setting (Graded Color Scale, to be precise) to make the outputs visually informative, setting a green gradient scale to distinguish between low-valued outputs and high-valued outputs.
The minimum-valued cell background is set to 'Green, Accent 6, Lighter 80%' and the maximum-valued cell background is set to 'Green, Accent 6'. This has worked well. The cell values near the maximum, however, can sometimes be difficult to read, since they are 'Black, Text 1' (not a great contrast with the darker Green).
I am hoping to add the same type of conditional formatting to the cell texts in the range of outputs to generate a color contrast: for example, in the lighter end of the gradient, the cell texts will be 'Black, Text', and in the darker end of the gradient, the cells texts will be 'White, Background.' Visually, that would solve my contrast issue.
Unfortunately, after reading through this forum and searching for conditional formatting guides on Google, I haven't found a solution on how to apply the two types of formatting (background and font) to the same range of cells. I am not practiced in VBA, so I am hoping for any pointer that involves Excel's native functionality, if that's possible.
To boil all this down into a one-liner: "How do I add gradient conditional formatting to both font and background to a range of cells?"
Thank you for the help!
I have done this in the past by creating a number of rules that give the appearance of a gradient on both. To do this however you would create as many rules you need to get the resolution you want. For example:
Suppose you want to assign font and background fill for each value in increments of 10% from 0 to 100%.
For this you need to get 10 font colors in rgb format that gradually shift in the gradient that you want here is a site that can help:
http://www.colorizer.org/
Then do the same with for you background colors.
Now pair a font and background color with the range that you want that rule to apply to and write the excel rule.
While this method is a pain to set up it avoids vba at all costs and if you use the sheet as a template for other sheets you won't have to mess with it much.
Creating your own sets of custom rules as per #rahicks answer in the most comprehensive way of doing this. If you have a fairly stable range of values, then a quick and dirty solution is to use Custom Number Formats.
On top of your current conditional formatting, apply a Custom Number Format using a condition. This example sets the colour to white if the value is greater than 50, and then uses the existing colour otherwise.
[White][>50]General;General
You'll need to replace 50 with the mid-point of your data range and you'll also need to replace both instances of General with whatever number format you currently have on the range.

Conditional Formatting with two or more conditions in same column

I want to highlight multiple rows in a table based on multiple values in one column. For example if the column was a list of colors, I want to highlight all rows with the colors Blue, Green or Red in Column D. I tried Conditional Formatting with the rule:
=IF(OR($D1=”Blue”,$D1="Green",$D1="Red"))
but it does not work.
What am I doing wrong or is this even possible?
Yes, it is possible. First of all, you don’t need the IF, the conditional format is ‘triggered’ by a TRUE response to the Rule (though it does no harm!*) However I think your formula should work provided it is applied to the correct range (go to Manage Rules and check what Applies to is set to) and what you want is the same format for all of “Blue”, “Green” and “Red”.
If you want blue highlighting for Blue, green highlighting for Green etc (or similar) the simplest way may be to use an icon set or perhaps three separate rules (=D1="Blue", =D1="Green" etc) that can be applied in any order.
* Provided using the correct syntax - say as:
=IF(OR($D1="Blue",$D1="Green",$D1="Red"),TRUE,)
(note also no smart quotes).
=OR($D1="Blue",$D1="Green",$D1="Red")
should however be adequate.

Resources