50

I've got some cells that I have Conditionally Formatted to Excel's standard 'Bad' Style (Dark red text, light red fill).

In another column I have cells that I have created a Conditional Formatting formula for. I also want to code these to match the 'Bad' Style, but there isn't an option to use the pre-defined dark red text, light red fill. Instead I have to select my own formatting, but I can't find the correct Light/Dark red combination.

Does anyone know the RGB codes for at least the more common of the Conditional Formats?

  • 'Good'
  • 'Bad'
  • 'Neutral'
TylerH
  • 20,799
  • 66
  • 75
  • 101
a76marine
  • 1,669
  • 2
  • 12
  • 7

5 Answers5

106

For 'Bad' red:

  • The Font Is: (156,0,6)
  • The Background Is: (255,199,206)

For 'Good' green:

  • The Font Is: (0,97,0)
  • The Background Is: (198,239,206)

For 'Neutral' yellow:

  • The Font Is: (156,101,0)
  • The Background Is: (255,235,156)
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
a76marine
  • 1,669
  • 2
  • 12
  • 7
  • 43
    Just to make it easier, here are the hex color codes: Bad font: `#9C0006`, background: `#FFC7CE` --- Good font: `#006100`, background: `#C6EFCE` --- Neutral font: `#9C6500`, background: `#FFEB9C` – Ronan Paixão Aug 07 '17 at 14:46
  • 2
    If you're looking for the red-yellow-green color scale, the background values are: Red #F8696B/(248,105,107) - Yellow #FFEB84/(255,235,132) - Green #63BE7B/(99,190,123) – kevin948 Jan 10 '19 at 20:41
  • Is there a way to get these values through VBA, or is it strictly an external tool? – BenPen Nov 25 '19 at 19:35
  • 2
    @kevin948 And the Google Sheets version is Red #E67C73, Yellow #FFD666, Green #57BB8A – endolith Mar 18 '20 at 20:46
9

I imagine that these might possibly be changed with some styling options. But as far as default values go, these are taken from my version of Excel 2010 which should have the defaults.

"Bad" Red Font: 156, 0, 6; Fill: 255, 199, 206

"Good" Green Font: 0, 97, 0; Fill: 198, 239, 206

"Neutral" Yellow Font: 156, 101, 0; Fill: 255, 235, 156

Adam Shaver
  • 133
  • 1
  • 6
  • 2
    Not sure which way you found your own answer there, but for future reference, if you have access to Excel, it's pretty straightforward to get these values yourself. I formatted a few cells using each value and then picked a thick font like Arial Black so to get around the effects of font smoothing. If you have a color picker or eyedropper tool, that would be useful here. If not, a screenshot can be taken and then pasted in to MS Paint, allowing the use of its color picker tool. Cheers! – Adam Shaver Dec 22 '14 at 22:49
4

For anyone who stumbles across this in the future, this is how you do it:

xl.Range("A1:A1").Style := "Bad"
xl.Range("A1:A1").Style := "Good"
xl.Range("A1:A1").Style := "Neutral"

An easy way to check on things like this is to open excel and record a macro. In this case I recorded a macro where I just formatted the cell to "Bad". Once you've recorded the macro, just go in and edit it and it will essentially give you the code. It will require a little translation on your part, but here is what the macro looks like when I edit it:

 Selection.Style = "Bad"

As you can see, it's pretty easy to make the jump to AHK from what excel provides.

Jon
  • 239
  • 4
  • 15
  • The only down side to using the "Bad" style is that Font formatting such as bolding is cleared out. Unless this is something that can be overridden, needing to know the RGB values could be useful. Now, a beautiful answer would leave the VBA that was used to grab the RGB values as well. – BenPen Nov 25 '19 at 19:33
  • 1
    This does not answer the question, which is 'what are the RGB codes for the conditional formatting values in Excel' – TylerH Jun 20 '22 at 13:38
2

Light red fill with dark red text.

{'bg_color':   '#FFC7CE', 'font_color': '#9C0006'})

Light yellow fill with dark yellow text.

{'bg_color':   '#FFEB9C', 'font_color': '#9C6500'})

Green fill with dark green text.

{'bg_color':   '#C6EFCE', 'font_color': '#006100'})
il_raffa
  • 5,090
  • 129
  • 31
  • 36
Sudharsan S
  • 54
  • 1
  • 2
0

The easiest way to do this is to format a cell the way you want it, then use the "cell format ..." contextual menu to get to the fill and format colours, use the "more colors ..." button to get to the hexagon colour selector, select the custom tab.

The RGB colours are as in the table at the bottom of the pane. If you prefer HSL values change the color model from RGB to HSL. I have used this to change the saturation on my bad cells. A higher luminosity gives a worse results and the shade of all the cells is the same just the deepness of the colour is modified.

  • This does not answer the question, which is 'what are the RGB codes for the conditional formatting values in Excel' – TylerH Jun 20 '22 at 13:37