From e531b6ff5c696b0424cc63f348111a0897dedad8 Mon Sep 17 00:00:00 2001 From: Dione Maddern Date: Sat, 23 Mar 2024 00:16:51 +0100 Subject: #tdf120179 Rewrite SUMIF Help Page Created a new file named text/scalc/01/func_sumif.xhp. This file includes updated help information for the SUMIF function, including a more precise definitiion of and more detailed examples. Added the new file text/scalc/01/func_sumif.xhp to AllLangHelp_scalc.mk so that it will be included in the Help application. Replaced the content in text/scalc/01/04060106#Section15 ("SUMIF") with an embed link to the new text/scalc/01/func_sumif.xhp, so that only the definition and a link to the main SUMIF Function page appears in the list of Mathematical Functions. Updated the "Related Topics" sections of text/scalc/01/func_sum.xhp and text/scalc/01/func_sumifs.xhp so that they link to the new SUMIF Function page. Change-Id: I224dffb0c3c6411ea416bba308559f9fe3896dd2 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/165186 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- AllLangHelp_scalc.mk | 1 + source/text/scalc/01/04060106.xhp | 23 +---------- source/text/scalc/01/func_sum.xhp | 2 +- source/text/scalc/01/func_sumif.xhp | 75 ++++++++++++++++++++++++++++++++++++ source/text/scalc/01/func_sumifs.xhp | 2 +- 5 files changed, 79 insertions(+), 24 deletions(-) create mode 100644 source/text/scalc/01/func_sumif.xhp diff --git a/AllLangHelp_scalc.mk b/AllLangHelp_scalc.mk index 815e8e7a61..10fc142be4 100644 --- a/AllLangHelp_scalc.mk +++ b/AllLangHelp_scalc.mk @@ -275,6 +275,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\ helpcontent2/source/text/scalc/01/func_sortby \ helpcontent2/source/text/scalc/01/func_style \ helpcontent2/source/text/scalc/01/func_sum \ + helpcontent2/source/text/scalc/01/func_sumif \ helpcontent2/source/text/scalc/01/func_sumifs \ helpcontent2/source/text/scalc/01/func_switch \ helpcontent2/source/text/scalc/01/func_textjoin \ diff --git a/source/text/scalc/01/04060106.xhp b/source/text/scalc/01/04060106.xhp index 17ddd9643c..e10a68ae61 100644 --- a/source/text/scalc/01/04060106.xhp +++ b/source/text/scalc/01/04060106.xhp @@ -986,27 +986,7 @@
- - SUMIF function - adding;specified numbers - -mw added one entry - - -

SUMIF

-Adds the cells specified by a given criterion. This function is used to sum a range when you search for a certain value. - - -SUMIF(Range; Criterion [; SumRange]) -Range is the range to which the criterion is to be applied. - -SumRange is the range from which values are summed. If this parameter has not been indicated, the values found in the Range are summed. -SUMIF supports the reference concatenation operator (~) only in the Range parameter, and only if the optional SumRange parameter is not given. - - -To sum up only negative numbers: =SUMIF(A1:A10;"<0") -=SUMIF(A1:A10;">0";B1:B10) - sums values from the range B1:B10 only if the corresponding values in the range A1:A10 are >0. -See COUNTIF() for some more syntax examples that can be used with SUMIF(). +
@@ -1014,7 +994,6 @@
-

diff --git a/source/text/scalc/01/func_sum.xhp b/source/text/scalc/01/func_sum.xhp index 3aef7d8edf..ade627b857 100644 --- a/source/text/scalc/01/func_sum.xhp +++ b/source/text/scalc/01/func_sum.xhp @@ -39,7 +39,7 @@
SUM wiki page. - , + ,
diff --git a/source/text/scalc/01/func_sumif.xhp b/source/text/scalc/01/func_sumif.xhp new file mode 100644 index 0000000000..ed4a5228e5 --- /dev/null +++ b/source/text/scalc/01/func_sumif.xhp @@ -0,0 +1,75 @@ + + + + + + SUMIF Function + /text/scalc/01/func_sumif.xhp + + + + +
+ + SUMIF function + adding;specified numbers + + +

SUMIF

+ + Determines which values in a range of cells meet a specified criterion, then returns the sum of the matching values. Alternatively the function can determine which values in one range of cells meet a criterion, then return the sum of values in the corresponding cells in a second range of cells. +
+SUMIF can only apply a single criterion to a range. Use SUMIFS if you need to apply mulitiple criteria. + + + SUMIF(Range; Criterion [;SumRange]) + Range: The range of cells to which the criterion is applied. + SUMIF supports the reference concatenation operator (~) only in the Range parameter, and only if the optional SumRange parameter is not given. + + + SumRange: Optional. The range of cells from which values are summed. If no SumRange is given, the values in the Range are summed. + +
+ +

Simple usage

+ =SUMIF(C2:C6,">=100") + Sums only the values from range C2:C6 that are >=100. Returns 370 because cells C2:C3 do not meet the criterion. The values from Range are summed because no SumRange is given. + =SUMIF(B2:B5,">=20",C2:C6) + Sums values from the range B2:B6 only if the corresponding values in the range A1:A5 are >=20. Returns 340 because the fifth and sixth rows do not meet the criterion. +

Using regular expressions

+ =SUMIF(A2:A6,"pen",C2:C5) + Sums values from the range C2:C6 only if the corresponding range in A2:A6 exactly match the letters "pen". Returns 85 because rows A2 and A4:A6 do not meet the criterion. + =SUMIF(A2:A6,"pen*",C2:C6) + Sums the values from the range C2:C6 only if the corresponding cell in range A2:A6 contains the letters "pen". Returns the value 150 because rows A4:A5 do not meet the criterion. + =SUMIF(ProductName,"pen*",Revenue) + A named range can be given as the Range or SumRange paramater. For example, if the columns in the above table are respectively named "ProductName", "Sales", and "Revenue", the function returns 150. This function will only work as described if you have defined the names of the columns using the Define Names dialog. +

Reference to a cell as a criterion

+ If you need to change a criterion easily, you may specify it in a separate cell and use a reference to this cell in the condition of the SUMIFS function. For example: + =SUMIF(A2:A6,E2,C2:C6) + If E2 = pen, the function returns 85 because the link to the cell is substituted with its contents. +
+
+ SUMIF wiki page. + + , + + + + , + , + , + , + + + + +
+ +
\ No newline at end of file diff --git a/source/text/scalc/01/func_sumifs.xhp b/source/text/scalc/01/func_sumifs.xhp index 9afb3d5d35..bcab3c7c62 100644 --- a/source/text/scalc/01/func_sumifs.xhp +++ b/source/text/scalc/01/func_sumifs.xhp @@ -59,7 +59,7 @@ SUMIFS wiki page. , - + , -- cgit v1.2.3