Contido

# STYLE function

Applies a style to the cell containing the formula. After a set amount of time, another style can be applied.

This function always returns the numeric value 0, which allows to use it by adding the STYLE function to other functions in the same cell without changing its value.

The STYLE function should not be used without compelling reason, its purpose is the use with asynchronous Add-In functions to visually notify about the availability of a result. In almost all other cases using conditional formatting instead is a better choice.

### Sintaxe

STYLE("Style" [; Time [; "Style2"]])

Style is the name of the cell style to be applied to the cell. Style names are not case-sensitive and must be entered in quotation marks.

Time is an optional time range in seconds. After this time is elapsed, the style defined in Style2 is applied. Leave this parameter blank if you do not want the style to be changed.

Style2 is the optional name of a cell style assigned to the cell after the time specified in the Time parameter has passed. If this parameter is missing the "Default" cell style is applied.

Nas funcións de LibreOffice Calc, os parámetros marcados como «opcional» só poden omitirse cando non haxa ningún outro parámetro a seguir. Por exemplo, nunha función de catro parámetros, dos cales só os dous últimos aparecen marcados como «opcional», pódese omitir o parámetro 4 ou os parámetros 3 e 4, mais non é posíbel omitir exclusivamente o parámetro 3.

### Exemplos

=10+STYLE("Good",60,"Neutral")

Enters the value 10 into the cell and applies the style named "Good". After 60 seconds, the style "Neutral" is applied.

=A1*A2+STYLE(IF(CURRENT()<100,"Bad","Good"))

Enters the result of multiplying the values in cells A1 and A2 and applies the style "Bad" if the result is less than 100, otherwise the style "Good" is applied. Here the function CURRENT() is used to get the currently evaluated value of the function in the cell.

="Total"&T(STYLE("Result"))

Enters the text "Total" into the cell and applies the style named "Result". Note that this example deals with textual values, hence the output of the STYLE function needs to be appended to the text using the & operator. The function T() is used to prevent the number "0" being appended to the resulting text.

#### Información técnica

Esta función NON é parte do estándar Formato Open Document para Aplicacións de Ofimática (OpenDocument), versión 1.3. Parte 4: Fórmula recalculada (OpenFormula). O espazo de nomes é

ORG.OPENOFFICE.STYLE

Temas relacionados

STYLE wiki page.

Spreadsheet Functions

Assigning Formats by Formula

CURRENT function

T function

Precisamos da súa axuda!