I would like to set a cell’s color by referring to another cell’s content, such that if the referred cell contains a hexadecimal or decimal number, the colored cell would use that number as its RGB values for its color.
So instead of a 1 dimensional scale like the “Color Scale” in Conditional Formatting, this would, in a sense, be a 3D Color Scale.
type a hex RGB code code in cell A1 (with or without a hashtag)
in cell C1, type =BACKGROUND(B1;A1)
cell B1 should now be colored according to the code in A1
There are other proposed solutions in this forum topic. Feel free to check it out and if you try any, please comment down to let us know how it went on LibreOffice. I don’t really have the time or interest to try them personally since the above solution does it for me.
There’s also this solution which doesn’t seem so handy since you have to write the cell range directly in the macro :
Finally, if you’re interested, it’s possible to do it the other way around and get a color code written in a cell based on another cell’s background color: