summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2024-03-27 09:47:25 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2024-03-27 19:30:20 +0100
commit9736fda4e1a2994e1ea7377c37f61bad058f69b8 (patch)
tree017a72fa752df459cac2e42d0d27d6dd7bff0016
parent9f4e1983f6edae8f5ce8ee2e319410d4e1e39084 (diff)
tdf#159872 Help page for SORT function (final).
Change-Id: Ib3385327c2fab41a0a9d76bf8913e76c46864059 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/165430 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r--source/text/scalc/01/ex_data_stat_func.xhp2
-rw-r--r--source/text/scalc/01/func_averageifs.xhp4
-rw-r--r--source/text/scalc/01/func_sort.xhp134
3 files changed, 135 insertions, 5 deletions
diff --git a/source/text/scalc/01/ex_data_stat_func.xhp b/source/text/scalc/01/ex_data_stat_func.xhp
index fef3ee0545..c7898b6ea8 100644
--- a/source/text/scalc/01/ex_data_stat_func.xhp
+++ b/source/text/scalc/01/ex_data_stat_func.xhp
@@ -18,6 +18,7 @@
<body>
<section id="ex_func_average">
+<section id="ex_func_average_table">
<paragraph role="paragraph" id="hd_id2609201512474295">Consider the following table</paragraph>
<table id="table_averageif_example">
<tablerow>
@@ -118,6 +119,7 @@
</tablecell>
</tablerow>
</table>
+</section>
<warning id="par_id1191767622119">In all examples below, ranges for calculation contain the row #6, which is ignored because it contains text.</warning>
</section>
<paragraph role="paragraph" id="par_id961527953004850"><variable id="args">Func_Range; Range1; Criterion[; Range2; Criterion2][; … ; [Range127; Criterion127]]</variable></paragraph>
diff --git a/source/text/scalc/01/func_averageifs.xhp b/source/text/scalc/01/func_averageifs.xhp
index 0da2629284..53b007c8ce 100644
--- a/source/text/scalc/01/func_averageifs.xhp
+++ b/source/text/scalc/01/func_averageifs.xhp
@@ -36,8 +36,7 @@
<embed href="text/scalc/01/ex_data_stat_func.xhp#warning01"/>
<embed href="text/scalc/01/ex_data_stat_func.xhp#note01"/>
<embed href="text/scalc/01/ex_data_stat_func.xhp#par01"/>
-
-<embed href="text/scalc/01/ODFF.xhp#odff"/>
+<embed href="text/scalc/01/ful_func.xhp#func_head_example"/>
<embed href="text/scalc/01/ex_data_stat_func.xhp#ex_func_average"/>
<h4 id="hd_id20733192524041">Simple usage</h4>
<paragraph id="par_id24004653627203" role="paragraph"><item type="input">=AVERAGEIFS(B2:B6;B2:B6;"&gt;=20")</item></paragraph>
@@ -54,6 +53,7 @@
<paragraph id="par_id67531072426731" role="paragraph"><item type="input">=AVERAGEIFS(C2:C6;A2:A6;E2&amp;".*";B2:B6;"&lt;"&amp;MAX(B2:B6))</item></paragraph>
<paragraph id="par_id65612244926745" role="paragraph">If E2 = pen, the function returns 65, because the link to the cell is substituted with its content.</paragraph>
<embed href="text/scalc/06/calcsamplefiles.xhp#func_ifs"/>
+<embed href="text/scalc/01/ODFF.xhp#odff"/>
<section id="relatedtopics">
<tip id="par_id371677017196557"><link href="https://wiki.documentfoundation.org/Documentation/Calc_Functions/AVERAGEIFS">AVERAGEIFS wiki page</link>.</tip>
<paragraph id="par_id11921178730928" role="paragraph" localize="false">
diff --git a/source/text/scalc/01/func_sort.xhp b/source/text/scalc/01/func_sort.xhp
index 15d637ac43..7628d9b663 100644
--- a/source/text/scalc/01/func_sort.xhp
+++ b/source/text/scalc/01/func_sort.xhp
@@ -18,15 +18,143 @@
<body>
<bookmark id="bm_id221708806478124" branch="hid/SC_HID_FUNC_SORT_MS" localize="false"/>
<bookmark branch="index" id="bm_id361708283183878">
- <bookmark_value>SORT function</bookmark_value>
+<bookmark_value>SORT function</bookmark_value>
</bookmark>
<section id="sort">
<h1 id="hd_id901708806478126"><variable id="h1"><link href="text/scalc/01/func_sort.xhp">SORT</link></variable></h1>
- <paragraph id="par_id771708806478128" role="paragraph">(...)</paragraph>
+ <paragraph id="par_id771708806478128" role="paragraph">Sorts the contents of a range or array.</paragraph>
</section>
+<note id="par_id131711543270539">Enter the formula as an <link href="text/scalc/01/04060107.xhp">array formula</link>.</note>
<embed href="text/scalc/01/ful_func.xhp#func_head_syntax"/>
-<paragraph role="code" id="par_id211708281649651">SORT(...)</paragraph>
+<paragraph role="code" id="par_id211708281649651">SORT(Range [, SortIndex[, SortOrder[, ByCol]]])</paragraph>
+<paragraph role="paragraph" id="par_id551711457515235"><emph>Range:</emph> Required. The range or array to sort.</paragraph>
+<paragraph role="paragraph" id="par_id151711457520290"><emph>SortIndex:</emph> Optional. The number indicating the row or column to sort by.</paragraph>
+<paragraph role="paragraph" id="par_id131711457525811"><emph>SortOrder:</emph> Optional. A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order.</paragraph>
+<paragraph role="paragraph" id="par_id351711457531579"><emph>ByCol:</emph> Optional. A logical value indicating the desired sort direction; <emph>FALSE</emph> to sort by row (default), <emph>TRUE</emph> to sort by column.</paragraph>
+
<embed href="text/scalc/01/ful_func.xhp#func_head_example"/>
+<embed href="text/scalc/01/ex_data_stat_func.xhp#ex_func_average_table"/>
+<h4 id="hd_id751711480783220">Example with ascending order</h4>
+<paragraph role="paragraph" id="par_id131711466000482"><input>{=SORT(A2:C6,2,1)}</input> </paragraph>
+<paragraph role="paragraph" id="par_id471711472262161">Sort the range A2:C6 based on the second column in ascending order (Sales).</paragraph>
+<table id="result01">
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id31711465709083" role="tablecontent">book</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id151711465709084" localize="false" role="tablecontent">17</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id861711465709085" localize="false" role="tablecontent">180</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id861711465758906" role="tablecontent">pencil</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id971711465758907" localize="false" role="tablecontent">20</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id831711465758908" localize="false" role="tablecontent">65</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id331711465788257" role="tablecontent">notebook</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id531711465788258" localize="false" role="tablecontent">20</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id641711465788260" localize="false" role="tablecontent">190</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id821711465827777" role="tablecontent">pen</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id141711465827778" localize="false" role="tablecontent">35</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id431711465827779" localize="false" role="tablecontent">85</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id11711465871342" role="tablecontent">pencil-case</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id771711465871343" localize="false" role="tablecontent">not</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id911711465871344" localize="false" role="tablecontent">not</paragraph>
+ </tablecell>
+</tablerow>
+</table>
+<h4 id="hd_id51711480751179">Example with descending order</h4>
+<paragraph role="paragraph" id="par_id731711466320553"><input>{=SORT(A2:C6,3,-1)}</input> </paragraph>
+<paragraph role="paragraph" id="par_id401711479167509">Sort the range A2:C6 based on the third column in descending order (Revenue).</paragraph>
+<table id="result02">
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id821711478931934" role="tablecontent">pencil-case</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id401711478935550" localize="false" role="tablecontent">not</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id551711478938510" localize="false" role="tablecontent">not</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id721711478941598" role="tablecontent">notebook</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id601711478944454" localize="false" role="tablecontent">20</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id451711478947461" localize="false" role="tablecontent">190</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id281711478950341" role="tablecontent">book</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id381711478953613" localize="false" role="tablecontent">17</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id731711478956157" localize="false" role="tablecontent">180</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id101711478960309" role="tablecontent">pen</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id681711478963398" localize="false" role="tablecontent">35</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id671711478966117" localize="false" role="tablecontent">85</paragraph>
+ </tablecell>
+</tablerow>
+<tablerow>
+ <tablecell>
+ <paragraph id="par_id911711478969701" role="tablecontent">pencil</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id151711478972741" localize="false" role="tablecontent">20</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id451711478975756" localize="false" role="tablecontent">65</paragraph>
+ </tablecell>
+</tablerow>
+</table>
+
<embed href="text/scalc/01/common_func.xhp#sectiontechinfo"/>
<embed href="text/scalc/00/avail_release.xhp#24.8"/>
<embed href="text/scalc/01/common_func.xhp#notODFF"/>