3

I have a column of containing the days of the week.

|dow | 
|----|
|Tue |
|Wed |
|Thu |
|Thu |

I would like to color the background of each day differently. So every Mon would have the same color and every Tue would have the same color etc. I don't care what colors each day has. I just want them to be different.

  • 4
    Have you tried conditional formatting? – Fox Mar 15 '17 at 20:52
  • I can see how to assign a style to a value. So I can make the text of 'Mon' have a background of red. I could repeat this for each day. I was wondering whether there is a way to avoid having to hard code each day. – Will Humphreys Mar 15 '17 at 21:01
  • You could create a new sheet and put the day-names there, then match against that list. But you would still be hard-coding values, just in a different place. – Fox Mar 15 '17 at 21:07
  • 1
    You could convert weekdays to numbers (Sun>0, Mon>1, etc.), then find three functions to convert those numbers to the numeric values for the red, green and blue components of the background color... It is _way_ simpler to hard code seven values. – Dario Mar 15 '17 at 22:03
  • @tohuwawohu Read what I have written. Maybe my wording could have been clearer, but I meant exactly what you you mean. I did __not__ write that “[computing] is simpler _than_ [hardcoding]”, I wrote the opposite: “[hardcoding] is way simpler [than computing]”. Sorry for not being clear enough. – Dario Mar 16 '17 at 06:36
  • @Dario: sorry - you're right, i took me some moments to understand your approach. In fact, e.g. using the CODE() function on the cell content's first three letters could be used to construct an individual RGB code for each weekday. But implementation would require some macro code, to set the background color according to that RGB code, i fear. – tohuwawohu Mar 16 '17 at 06:52

0 Answers0