Difference between revisions of "Documentation/How Tos/Calc: STYLE function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(Initial content) |
|||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Documentation/MasterTOC | |
+ | |bookid=1234''' | ||
+ | |booktitle=<div style="padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;">CALC FUNCTIONS</div> | ||
+ | |ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Spreadsheet_functions|<div style="font-size: 140%;">Spreadsheet Functions]] | ||
+ | |ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_Statistical_functions | ||
+ | |ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_HYPERLINK_function | ||
+ | |ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Number_Conversion_functions | ||
+ | |ShowNextPart=block|NextPart=Documentation/How_Tos/Calc:_Statistical_functions | ||
+ | |toccontent= <div style="padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;">FUNCTIONS</div> | ||
+ | |||
+ | <div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Spreadsheet Lookup functions</div> | ||
+ | * [[Documentation/How_Tos/Calc:_ADDRESS_function|<div style="font-size: 120%;">Address]] | ||
+ | * [[Documentation/How_Tos/Calc:_CHOOSE_function|<div style="font-size: 120%;">Choose]] | ||
+ | * [[Documentation/How_Tos/Calc:_HLOOKUP_function|<div style="font-size: 120%;">Hlookup]] | ||
+ | * [[Documentation/How_Tos/Calc:_INDEX_function|<div style="font-size: 120%;">Index]] | ||
+ | * [[Documentation/How_Tos/Calc:_INDIRECT_function|<div style="font-size: 120%;">Indirect]] | ||
+ | * [[Documentation/How_Tos/Calc:_LOOKUP_function|<div style="font-size: 120%;">Lookup]] | ||
+ | * [[Documentation/How_Tos/Calc:_MATCH_function|<div style="font-size: 120%;">Math]] | ||
+ | * [[Documentation/How_Tos/Calc:_OFFSET_function|<div style="font-size: 120%;">Offset]] | ||
+ | * [[Documentation/How_Tos/Calc:_VLOOKUP_function|<div style="font-size: 120%;">Vlookup]] | ||
+ | |||
+ | <div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Spreadsheet Information functions</div> | ||
+ | * [[Documentation/How_Tos/Calc:_AREAS_function|<div style="font-size: 120%;">Areas]] | ||
+ | * [[Documentation/How_Tos/Calc:_COLUMN_function|<div style="font-size: 120%;">Column]] | ||
+ | * [[Documentation/How_Tos/Calc:_COLUMNS_function|<div style="font-size: 120%;">Columns]] | ||
+ | * [[Documentation/How_Tos/Calc:_ERRORTYPE_function|<div style="font-size: 120%;">Errortype]] | ||
+ | * [[Documentation/How_Tos/Calc:_INFO_function|<div style="font-size: 120%;">Info]] | ||
+ | * [[Documentation/How_Tos/Calc:_ROW_function|<div style="font-size: 120%;">Row]] | ||
+ | * [[Documentation/How_Tos/Calc:_ROWS_function|<div style="font-size: 120%;">Rows]] | ||
+ | * [[Documentation/How_Tos/Calc:_SHEET_function|<div style="font-size: 120%;">Sheet]] | ||
+ | * [[Documentation/How_Tos/Calc:_SHEETS_function|<div style="font-size: 120%;">Sheets]] | ||
+ | |||
+ | <div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Other functions</div> | ||
+ | * [[Documentation/How_Tos/Calc:_DDE_function|<div style="font-size: 120%;">Dde]] | ||
+ | * [[Documentation/How_Tos/Calc:_HYPERLINK_function|<div style="font-size: 120%;">Hyperlink]] | ||
+ | * [[Documentation/How_Tos/Calc:_STYLE_function|<div style="font-size: 120%; border-style: double; border-color:#778899;">Style]] | ||
+ | }}__TOC__ | ||
== STYLE == | == STYLE == | ||
Line 17: | Line 53: | ||
: <tt>'''STYLE'''</tt> returns the numeric value <tt>'''0'''</tt>, so it may be added on to an existing calculation in the cell without changing the result. See the examples below. | : <tt>'''STYLE'''</tt> returns the numeric value <tt>'''0'''</tt>, so it may be added on to an existing calculation in the cell without changing the result. See the examples below. | ||
+ | : Another way to apply styles can be found at '''Format - Conditional Formating...'''. | ||
+ | |||
+ | : There is no direct way to determine (in a formula) what formatting has been applied to a cell. | ||
=== Example: === | === Example: === | ||
In these examples, it is assumed you have created a new style "Red" where the cell has a red background. "Default" is the default style already defined in Calc. | In these examples, it is assumed you have created a new style "Red" where the cell has a red background. "Default" is the default style already defined in Calc. | ||
+ | |||
<tt>'''=3 + 5 + STYLE("Red"; 3; "Default")'''</tt> | <tt>'''=3 + 5 + STYLE("Red"; 3; "Default")'''</tt> | ||
Line 34: | Line 74: | ||
<tt>'''="Some text" & T(STYLE("Red"))'''</tt> | <tt>'''="Some text" & T(STYLE("Red"))'''</tt> | ||
− | : displays the text <tt>'''Some text'''</tt> with a red background. The <tt>'''STYLE'''</tt> function always returns <tt>'''0'''</tt>, so <tt>'''T(0)'''</tt> | + | : displays the text <tt>'''Some text'''</tt> with a red background. The <tt>'''STYLE'''</tt> function always returns <tt>'''0'''</tt>, so <tt>'''T(0)'''</tt> will return a zero length string which can be concatenated to an existing string without affecting it. |
− | = | + | <tt>'''=IF(STYLE("Red"); ""; <i>yourformula</i>)'''</tt> |
− | ''' | + | : where <tt>'''<i>yourformula</i>'''</tt> stands for some formula, displays the result of <tt>'''<i>yourformula</i>'''</tt> with a red background. This method might be useful if you cannot predict whether <tt>'''<i>yourformula</i>'''</tt> will return text or a number (for example with <tt>'''HLOOKUP'''</tt>). |
=== Issues: === | === Issues: === | ||
The STYLE function is unique to Calc. | The STYLE function is unique to Calc. | ||
+ | |||
+ | {{SeeAlso|EN| | ||
+ | * [[Documentation/How_Tos/Calc: SQRT function|SQRT]] | ||
+ | * [[Documentation/How_Tos/Calc: CURRENT function|CURRENT]] | ||
+ | * [[Documentation/How_Tos/Calc: T function|T]] | ||
+ | |||
+ | * [[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]] | ||
+ | |||
+ | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | ||
+ | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | ||
+ | [[Category: Documentation/Reference/Calc/Spreadsheet functions]] |
Revision as of 07:42, 17 July 2018
CALC FUNCTIONS