From 0b6f8089829c49f01e35ce7bb11d5e0e0dfc70f2 Mon Sep 17 00:00:00 2001 From: tagezi Date: Fri, 9 Oct 2015 23:54:35 +0300 Subject: Added description COUNTIFS function func_countifs.xhp is new In func_averageifs.xhp and func_averageifs.xhp: added the link to COUNTIFS corrected some typos Change-Id: I2f9980d331bac807b1e1e03af24b5660c0081118 Reviewed-on: https://gerrit.libreoffice.org/19288 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- source/text/scalc/01/04060181.xhp | 4 ++ source/text/scalc/01/func_averageifs.xhp | 4 +- source/text/scalc/01/func_countifs.xhp | 65 ++++++++++++++++++++++++++++++++ source/text/scalc/01/func_sumifs.xhp | 4 +- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 source/text/scalc/01/func_countifs.xhp (limited to 'source/text/scalc') diff --git a/source/text/scalc/01/04060181.xhp b/source/text/scalc/01/04060181.xhp index 56f748e5f2..53bbbfb2d9 100644 --- a/source/text/scalc/01/04060181.xhp +++ b/source/text/scalc/01/04060181.xhp @@ -130,6 +130,10 @@ oldref="547">COUNTIF =COUNTIF(A1:A10;C2) where cell C2 contains the text >2006 counts the number of cells in the range A1:A10 which are >2006 To count only negative numbers: =COUNTIF(A1:A10;"<0") + +
+ +
B function diff --git a/source/text/scalc/01/func_averageifs.xhp b/source/text/scalc/01/func_averageifs.xhp index bc450f062a..6fb90925ae 100644 --- a/source/text/scalc/01/func_averageifs.xhp +++ b/source/text/scalc/01/func_averageifs.xhp @@ -30,7 +30,7 @@ AVERAGEIFS(Average_range; Criterion_range1; Criterion1 [; Criterion_range2; Criterion2 [; ...]]) Average_range – required argument. It is a range of cells, a name of a named range or a label of a column or a row containing values for calculating the mean. Criterion_range1 – required argument. It is a range of cells, a name of a named range or a label of a column or a row containing values for finding the corresponding criterion. -Criterion1 – required argument. A condition in the form of expression or cell reference with expression that defines what cells should be used to calculate the mean. The expression can contain text, numbers or regular expressions. +Criterion1 – required argument. A condition in the form of expression or a cell reference to expression that defines what cells should be used to calculate the mean. The expression can contain text, numbers or regular expressions. Criterion_range2 – Optional. Criterion_range2 and all the following mean the same as Criterion_range1. Criterion2 – Optional. Criterion2 and all the following mean the same as Criterion1. The logical relation between criteria can be defined as logical AND (conjunction). In other words, if and only if all given criteria are met, a value from the corresponding cell of the given Average_range is taken into calculation of the mean.
@@ -58,7 +58,7 @@ If the range of values for calculating the mean and any range for finding criter =AVERAGEIFS(C2:C6;A2:A6;E2&".*";B2:B6;"<"&MAX(B2:B6)) If E2 = pen, the function returns 65, because the link to the cell is substituted with its content.
-AVERAGE, AVERAGEA, , , MAX, MIN +AVERAGE, AVERAGEA, , , MAX, MIN
diff --git a/source/text/scalc/01/func_countifs.xhp b/source/text/scalc/01/func_countifs.xhp new file mode 100644 index 0000000000..faa7a0b6df --- /dev/null +++ b/source/text/scalc/01/func_countifs.xhp @@ -0,0 +1,65 @@ + + + + + + + COUNTIFS function + text/scalc/01/func_countifs.xhp + + + + +
+ + + COUNTIFS function + counting row;satisfying criteria + counting column;satisfying criteria + +COUNTIFS function +Returns the count of rows or columns that meet criteria in multiple ranges. +
+Syntax +COUNTIFS(Range1; Criterion1 [; Range2; Criterion2 [; ...]]) +Range1 – required argument. It is a range of cells, a name of a named range or a label of a column or a row containing values for counting and finding the corresponding criterion. +Criterion1 – required argument. A condition in the form of expression or a cell reference to expression that defines what cells should be used for counting. The expression can contain text, numbers or regular expressions. +Criterion_range2 – Optional. Criterion_range2 and all the following mean the same as Criterion_range1. +Criterion2 – Optional. Criterion2 and all the following mean the same as Criterion1. +The logical relation between criteria can be defined as logical AND (conjunction). In other words, if and only if all given criteria are met, a row or a column is taken into counting.
+The Criterion needs to be a string expression, in particular, the Criterion needs to be enclosed in quotation marks ("Criterion") with the exception of the names of functions, cell references and the operator of a string concatenation (&).
+The operators equal to (=), not equal to (<>), greater than (>), greater than or equal to (>=), less than (<), and less than or equal to (<=) can be used in criterion arguments for comparison of numbers.
+The function can have up to 500 arguments, meaning that you can specify 250 pairs of ranges and criteria.
+ +If a cell contains TRUE, it is treated as 1, if a cell contains FALSE – as 0 (zero).
+If ranges for arguments Range have unequal sizes, the function returns err:502.
+ +Simple usage +=COUNTIFS(B2:B6;">=20") +Counts the amount of rows of the range B2:B6 with values greater than or equal to 20. Returns 3, because the fifth and the sixth rows do not meet the criterion. +=COUNTIFS(B2:B6;">=20";C2:C6;">70") +Counts the amount of rows that contain simultaneously values greater than 70 in the C2:C6 range and values greater than or equal to 20 in the B2:B6 range. Returns 2, because the second, the fifth and the sixth rows do not meet at least one criterion. +Using regular expressions and nested functions +=COUNTIFS(B2:B6;"[:alpha:]*") +Counts the amount of rows of the B2:B6 range that contain only alphabet symbols. Returns 1, because only sixth row meets the criterion. +=COUNTIFS(B2:B6;">"&MIN(B2:B6);B2:B6;"<"&MAX(B2:B6)) +Counts the amount of rows of the B2:B6 range excluding rows with minimum and maximum values of this range. Returns 2, because the third, the fifth and the sixth rows do not meet at least one criterion. +=COUNTIFS(A2:A6;"pen.*";B2:B6;"<"&MAX(B2:B6)) +Counts the amount of rows that correspond to all cells of the A2:A6 range starting with "pen" and to all cells of the B2:B6 range with exception of its maximum. Returns 1, because only second row meets all criteria. +Reference to a cell as a criterion +If you need to change a criterion easily, you may want to specify it in a separate cell and use a reference to this cell in the condition of the COUNTIFS function. For example, the above function can be rewritten as follows: +=COUNTIFS(A2:A6;E2&".*";B2:B6;"<"&MAX(B2:B6)) +If E2 = pen, the function returns 1, because the link to the cell is substituted with its content and it works as a function above. +
+COUNT, COUNTIF, COUNTA, , , MAX, MIN + +
+ +
diff --git a/source/text/scalc/01/func_sumifs.xhp b/source/text/scalc/01/func_sumifs.xhp index 2e0e44ca47..1d5cefea29 100644 --- a/source/text/scalc/01/func_sumifs.xhp +++ b/source/text/scalc/01/func_sumifs.xhp @@ -32,7 +32,7 @@ Sum_Range – required argument. It is a range of cells, a name of a named range or a label of a column or a row containing values for calculating the sum. Criterion_range1 – required argument. It is a range of cells, a name of a named range or a label of a column or a row containing values for finding the corresponding criterion. -Criterion1 – required argument. A condition in the form of expression or cell reference with expression that defines what cells should be used to calculate the sum. The expression can contain text, numbers or regular expressions. +Criterion1 – required argument. A condition in the form of expression or a cell reference to expression that defines what cells should be used to calculate the sum. The expression can contain text, numbers or regular expressions. Criterion_range2 – Optional. Criterion_range2 and all the following mean the same as Criterion_range1. Criterion2 – Optional. Criterion2 and all the following mean the same as Criterion1. @@ -65,7 +65,7 @@ If the range of values for calculating the sum and any range for finding criteri If E2 = pen, the function returns 65, because the link to the cell is substituted with its content.
- SUM, SUMIF, , MAX, MIN + SUM, SUMIF, , MAX, MIN
-- cgit v1.2.3