LO Calc - style in formulae

I am wondering if it is possible in LO Calc to incorporate styles into
formula:

=if(*A1 is bold*, do this if true, do this if false)

*Henry*

If by "style" you mean local formatting - which is what "bold" is - then I think the answer has to be "no", since any cell could have a mixture of bold and not bold contents.

What could in principle be retrieved would be the cell style of a cell. If that facility had been provided, I imagine it would have been as part of the CELL() function - something like
=CELL("STYLE";Xn)
- but that's not available.

I trust this helps.

Brian Barker

In theory, it can be done.
In practice, forget it.
It requires creating a number of additional (^1) rows and columns, and
an exponential increase in places where errors are made. Not can be
made, but will be made, because edge cases were ignored. Almost
everything is, at least initially, an edge case.

^1: IIRC, it was on the order of 10,000 additional cells, for each cell
in which the comparison was made.

jonathon

Hello,
I do not think you can get the formatting information about a cell.
However, if the cell you want to look at has been set to a style which
identifies its formatting via a formula, you can use the FORMULA()
function to extract that information. For instance:
Cell A1 contains 25
Cell A2 contains =A1*1.8+32+STYLE("STYLE_BOLD")
You can create a formula like:
=IF(NOT(ISERROR(FIND("STYLE_BOLD";FORMULA(A2))));"Bold";"Not bold")
to find out if the cell has been formatted as bold or not. Of course,
you will need to create and assign the styles to the various cells, but
you should be able achieve something with this method.
I hope this helps.
Rémy Gauthier.