Forum Discussion

Bryon Smedley's avatar
Bryon Smedley
Copper Contributor
Oct 22, 2018

Excel Formula Color Coding Logic

Is there any documentation as to the color coding logic Excel uses when applying color to a formula during edit mode?  (see example below)

 

Excel Formula Colors (example)

I create training material and like to preserve the coloring of the formulas in my documentation (i.e. Word, HTML, etc...) while in edit mode.  Currently I have to replicate the color(s) manually which takes a bit of time and is quite tedious.  I was hoping to automate this process somehow but am not sure how Excel decides what parts of the formula should be a specific color.

 

Any and all help is appreciated.  Thank you in advance.

4 Replies

  • Bryon Smedley's avatar
    Bryon Smedley
    Copper Contributor
    Thank you for your reply. I understand what the colors are and how they repeat, my question lies in which variables get which colors; i.e. variable's order within a function, function order, function depth within the formula, etc... I know it's an odd question, but I have to assume that someone at some point mapped all of these rules out in order to program them into Excel.
    • JKPieterse's avatar
      JKPieterse
      Silver Contributor

      As Ingeborg says: there is no logic other than a simple left-to-right order of appearance in the formula, with one exception: repeating references have the same colour as their first appearance.

      Note that the colors are different for other versions of Excel. I picked up the colors from my Excel 2016. Those appear to be less intense than the colors of Excel 2010.

    • IngeborgHawighorst's avatar
      IngeborgHawighorst
      MVP

      Hello,

       

      I'm not sure that this is documented anywhere. My experience is that the colour coding in the formula references is strictly on a left to right basis. The first reference to a cell, range or named range will be blue, the next one red, and so on. If a reference is used more than once in a formula, each mention of that reference will get the same colour as the first mention of that reference. If cell addresses are used interchangeably with range names, they will get the same colour assigned. 

       

       

      Does that help?

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    It appears as if it is a fixed left-to-right (repeating) sequence of these (RGB) colors:
    199 106 50
    62 53 192
    183 87 129
    32 124 0
    132 62 176
    0 73 182
    146 115 38

Resources