From e8b0e4366701e46f775cca486ee65a1291c56456 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Wed, 27 Mar 2024 15:26:45 -0300 Subject: tdf#159872 Help page for SORTBY function (final). Change-Id: If3f9746d20aa60bab06c2607e5d8fce557e91f75 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/165431 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/scalc/01/ex_data_stat_func.xhp | 12 +-- source/text/scalc/01/func_sort.xhp | 3 +- source/text/scalc/01/func_sortby.xhp | 162 ++++++++++++++++++++++++++++- 3 files changed, 167 insertions(+), 10 deletions(-) diff --git a/source/text/scalc/01/ex_data_stat_func.xhp b/source/text/scalc/01/ex_data_stat_func.xhp index c7898b6ea8..994116e365 100644 --- a/source/text/scalc/01/ex_data_stat_func.xhp +++ b/source/text/scalc/01/ex_data_stat_func.xhp @@ -42,10 +42,10 @@ Product Name - Sales + Sales - Revenue + Revenue @@ -106,16 +106,16 @@ - 6 + 6 - pencil-case + pencil-case - not + not - not + not diff --git a/source/text/scalc/01/func_sort.xhp b/source/text/scalc/01/func_sort.xhp index 7628d9b663..e0f9b694c8 100644 --- a/source/text/scalc/01/func_sort.xhp +++ b/source/text/scalc/01/func_sort.xhp @@ -10,7 +10,7 @@ --> - + SORT function /text/scalc/01/func_sort.xhp @@ -161,6 +161,7 @@ COM.MICROSOFT.SORT
SORT wiki page. +
diff --git a/source/text/scalc/01/func_sortby.xhp b/source/text/scalc/01/func_sortby.xhp index 41d272f6dd..d22710928e 100644 --- a/source/text/scalc/01/func_sortby.xhp +++ b/source/text/scalc/01/func_sortby.xhp @@ -18,21 +18,177 @@ - SORTBY function +SORTBY function

SORTBY

- (...) + Sorts the contents of a range or array based on the values in a corresponding range or array.
-SORTBY(...) +SORTBY(Range, SortByRange1, SortOrder1[, SortByRange2, SortOrder2,[...]]) +Range: The array or range to sort. +SortByRange1, SortByRange2,... : Range 1, range 2,... are the arrays or ranges to sort on. +SortOrder1, SortOrder2,... : Order 1, order 2,... are the orders to use for sorting. 1 for ascending, -1 for descending. Default is ascending. +
+ Consider the following table + + + + + + A + + + B + + + C + + + + + 1 + + + Product Name + + + Sales + + + Revenue + + + + + 2 + + + pencil + + + 20 + + + 65 + + + + + 3 + + + pen + + + 35 + + + 85 + + + + + 4 + + + notebook + + + 20 + + + 190 + + + + + 5 + + + book + + + 17 + + + 180 + + + + + 6 + + + pencil-case + + + not + + + not + + + + + 7 + + + pen + + + 10 + + + 45 + + +
+
+

Example with ascending order and descending order (for English locale)

+{=SORTBY(A2:C7,A2:A7,1,C2:C7,-1)} +Sort the range A2:C7 based on the first column in ascending order and third column in descending order. + + + book + 17 + 180 + + + notebook + 20 + 190 + + + pen + 35 + 85 + + + pen + 10 + 45 + + + pencil + 20 + 65 + + + pencil-case + not + not + +
+ COM.MICROSOFT.SORTBY
SORTBY wiki page. +
-- cgit