| Server IP : 121.121.20.254 / Your IP : 216.73.217.141 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files/LibreOffice/help/en-US/text/scalc/01/ |
Upload File : |
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<base href="../../../../">
<noscript><meta http-equiv="refresh" content="0; URL=../../../../en-US/noscript.html"></noscript>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>STYLE function</title>
<link rel="shortcut icon" href="media/navigation/favicon.ico">
<link type="text/css" href="normalize.css" rel="Stylesheet">
<link type="text/css" href="prism.css" rel="Stylesheet">
<link type="text/css" href="default.css" rel="Stylesheet">
<script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="languages.js"></script><script type="text/javascript" src="en-US/langnames.js"></script><script type="text/javascript" src="flexsearch.debug.js"></script><script type="text/javascript" src="prism.js"></script><script type="text/javascript" src="help2.js" defer></script><script type="text/javascript" src="a11y-toggle.js" defer></script><script type="text/javascript" src="paginathing.js" defer></script><script type="text/javascript" src="en-US/bookmarks.js" defer></script><script type="text/javascript" src="en-US/contents.js" defer></script><script type="text/javascript" src="help.js" defer></script><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<header id="TopLeftHeader"><a class="symbol" href="en-US/text/shared/05/new_help.html"><div></div></a><a class="logo" href="en-US/text/shared/05/new_help.html"><p dir="auto">LibreOffice 24.2 Help</p></a><div class="dropdowns"><div class="modules">
<button type="button" data-a11y-toggle="modules-nav" id="modules" aria-haspopup="true" aria-expanded="false" aria-controls="modules-nav">Module</button><nav id="modules-nav" hidden=""></nav>
</div></div></header><aside class="leftside"><input id="accordion-1" name="accordion-menu" type="checkbox"><label for="accordion-1" dir="auto">Contents</label><div id="Contents" class="contents-treeview"></div></aside><div id="SearchFrame"><div id="Bookmarks">
<input id="search-bar" type="search" class="search" placeholder="Search in bookmarks for chosen module" dir="auto"><div class="nav-container" tabindex="0"><nav class="index" dir="auto"></nav></div>
</div></div>
<div id="DisplayArea" itemprop="softwareHelp" itemscope="true" itemtype="http://schema.org/SoftwareApplication">
<a name="func_style_definition"></a>
<a name="bm_id3154342"></a>
<a name="bm_id346793467934121"></a>
<meta itemprop="keywords" content="STYLE function">
<h1 id="hd_id321673374992325" dir="auto">
<a name="func_style_header"></a>STYLE function</h1>
<p id="par_id441673375101757" class="paragraph" dir="auto"><span class="avis"><a name="func_style_desc"></a>Applies a style to the cell containing the formula.</span> After a set amount of time, another style can be applied.</p>
<p id="par_id681673375365338" class="paragraph" dir="auto">This function always returns the numeric value 0, which allows to use it by adding the <span class="emph">STYLE</span> function to other functions in the same cell without changing its value.</p>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id1670450904" dir="auto">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.</p></div>
</div>
<br>
<div class="embedded">
<a name="func_head_syntax"></a>
<h3 id="hd_id126511265112651" dir="auto">Syntax</h3>
</div>
<p id="par_id961673376106137" class="code" dir="auto">
STYLE("Style" [; Time [; "Style2"]])
</p>
<p id="par_id31673375542211" class="paragraph" dir="auto">
<span class="emph">Style</span> 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.
</p>
<p id="par_id161673375589532" class="paragraph" dir="auto">
<span class="emph">Time</span> is an optional time range in seconds. After this time is elapsed, the style defined in <span class="emph">Style2</span> is applied. Leave this parameter blank if you do not want the style to be changed.
</p>
<p id="par_id81673375703156" class="paragraph" dir="auto">
<span class="emph">Style2</span> is the optional name of a cell style assigned to the cell after the time specified in the <span class="emph">Time</span> parameter has passed. If this parameter is missing the "Default" cell style is applied.
</p>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id971673376620554" dir="auto">In the LibreOffice Calc functions, parameters marked as "optional" can be left out only when no parameter follows. For example, in a function with four parameters, where the last two parameters are marked as "optional", you can leave out parameter 4 or parameters 3 and 4, but you cannot leave out parameter 3 alone.</p></div>
</div>
<br>
<div class="embedded">
<a name="func_head_example"></a>
<h3 id="hd_id980889808898088" dir="auto">Examples</h3>
</div>
<p id="par_id491673376748686" class="paragraph" dir="auto">
<span class="input" data-tooltip="Click on text to copy to clipboard">=10+STYLE("Good",60,"Neutral")</span>
</p>
<p id="par_id11673376842469" class="paragraph" dir="auto">Enters the value 10 into the cell and applies the style named "Good". After 60 seconds, the style "Neutral" is applied.</p>
<p id="par_id271673376901358" class="paragraph" dir="auto">
<span class="input" data-tooltip="Click on text to copy to clipboard">=A1*A2+STYLE(IF(CURRENT()<100,"Bad","Good"))</span>
</p>
<p id="par_id1001673377339392" class="paragraph" dir="auto">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 <span class="emph">CURRENT()</span> is used to get the currently evaluated value of the function in the cell.</p>
<p id="par_id761673377678426" class="paragraph" dir="auto">
<span class="input" data-tooltip="Click on text to copy to clipboard">="Total"&T(STYLE("Result"))</span>
</p>
<p id="par_id871673377683120" class="paragraph" dir="auto">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 <span class="emph">STYLE</span> function needs to be appended to the text using the & operator. The function <span class="emph">T()</span> is used to prevent the number "0" being appended to the resulting text.</p>
<div class="embedded">
<a name="sectiontechinfo"></a>
<h4 id="hd_id301640873452726" dir="auto">Technical information</h4>
</div>
<div class="embedded">
<a name="notODFF"></a>
<p id="par_id251640873774457" class="paragraph" dir="auto">This function is not part of the <span class="emph">Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format</span> standard. The name space is</p>
</div>
<p id="par_id311644873986703" class="paragraph" dir="auto"><span class="literal">ORG.OPENOFFICE.STYLE</span></p>
<a name="relatedtopics"></a><div class="relatedtopics">
<p class="related" itemprop="mentions" dir="auto"><a name="related"></a><span class="emph">Related Topics</span>
</p>
<div class="relatedbody" itemprop="mentions">
<div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id201677014634447" dir="auto"><a target="_blank" href="https://wiki.documentfoundation.org/Documentation/Calc_Functions/STYLE">STYLE wiki page</a>.</p></div>
</div>
<br>
<p id="par_id631673379195650" class="paragraph" dir="auto"><a target="_top" href="en-US/text/scalc/01/04060109.html">Spreadsheet Functions</a></p>
<p id="par_id151673379420755" class="paragraph" dir="auto"><a target="_top" href="en-US/text/scalc/guide/cellstyle_by_formula.html">Assigning Formats by Formula</a></p>
<p id="par_id461673376361959" class="paragraph" dir="auto"><a target="_top" href="en-US/text/scalc/01/04060104.html#func_current_description">CURRENT function</a></p>
<p id="par_id381673378944042" class="paragraph" dir="auto"><a target="_top" href="en-US/text/scalc/01/04060110.html#t">T function</a></p>
</div>
</div>
</div>
<div id="DonationFrame"></div>
<footer><div id="DEBUG" class="debug">
<h3 class="bug">Help content debug info:</h3>
<p dir="auto">This page is: <a href="https://opengrok.libreoffice.org/xref/help/source/text/scalc/01/func_style.xhp" target="_blank">/text/scalc/01/func_style.xhp</a></p>
<p dir="auto">Title is: STYLE function</p>
<p id="bm_module" dir="auto"></p>
<p id="bm_system" dir="auto"></p>
<p id="bm_HID" dir="auto"></p>
</div></footer>
</body>
</html>