Score:2

Accessing the color of a cell through a LibreOffice Calc formula

in flag

I would like to access the color (background or foreground) of a particular cell in a formula (in LIBREOFFICE CALC) so that the result depends on that color.

I would be grateful for tips on how to accomplish this.

waltinator avatar
it flag
"Access the color"? From where? Command line, bash/python/perl script, php, LibreOffice Calc macro, ... ? The `.odt` format is documented.
Jim K avatar
lu flag
The only way is with a macro, as in the comment by @tohuwawohu.
tohuwawohu avatar
in flag
Does [this](https://stackoverflow.com/a/19313486) help?
Score:0
in flag

There are two main methods of achieving this:

  1. By using Conditional Formatting
  2. Using the STYLE() function with numbers or text.

With acknowledgements to This reference from The Linux Page which explains the methodologies to apply in both cases.

LibreOffice Documentation:
Conditional Formatting
STYLE() function
COLOR()

Hans-Joachim Buschmann avatar
in flag
Unfortunately, I expressed myself in a misleading way. The color should influence the result value of the formula. E.g.: red => 0; green => 1; etc.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.