Commit 24e5ae72 by Morten Welinder

### Funcs: add MINIFS and MAXIFS.

parent ddb17b84
 ... ... @@ -14,6 +14,8 @@ Morten: * New function SWITCH. * New function SUMIFS. * New function AVERAGEIFS. * New function MINIFS. * New function MAXIFS. * Fix criteria function issue with errors in the selector area. -------------------------------------------------------------------------- ... ...
 ... ... @@ -3311,8 +3311,9 @@ The depreciation coefficient used is: @CATEGORY=Mathematics @FUNCTION=AVERAGEIFS @SHORTDESC=average of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria @SYNTAX=AVERAGEIFS(range1,criteria1,…) @ARGUMENTDESCRIPTION=@{range1}: cell area @SYNTAX=AVERAGEIFS(actual_range,range1,criteria1,…) @ARGUMENTDESCRIPTION=@{actual_range}: cell area @{range1}: cell area @{criteria1}: condition for a cell to be included @EXCEL=This function is Excel compatible. @SEEALSO=AVERAGE,AVERAGEIF ... ... @@ -3670,6 +3671,16 @@ The depreciation coefficient used is: @NOTE=If @{x} ≤ 0, LOG2 returns #NUM! @SEEALSO=EXP,LOG10,LOG @CATEGORY=Mathematics @FUNCTION=MAXIFS @SHORTDESC=maximum of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria @SYNTAX=MAXIFS(actual_range,range1,criteria1,…) @ARGUMENTDESCRIPTION=@{actual_range}: cell area @{range1}: cell area @{criteria1}: condition for a cell to be included @EXCEL=This function is Excel compatible. @SEEALSO=MIN,MINIFS @CATEGORY=Mathematics @FUNCTION=MDETERM @SHORTDESC=the determinant of the matrix @{matrix} ... ... @@ -3678,6 +3689,16 @@ The depreciation coefficient used is: @EXCEL=This function is Excel compatible. @SEEALSO=MMULT,MINVERSE @CATEGORY=Mathematics @FUNCTION=MINIFS @SHORTDESC=minimum of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria @SYNTAX=MINIFS(actual_range,range1,criteria1,…) @ARGUMENTDESCRIPTION=@{actual_range}: cell area @{range1}: cell area @{criteria1}: condition for a cell to be included @EXCEL=This function is Excel compatible. @SEEALSO=MIN,MAXIFS @CATEGORY=Mathematics @FUNCTION=MINVERSE @SHORTDESC=the inverse matrix of @{matrix} ... ... @@ -3975,8 +3996,9 @@ If @{d} is less than zero, @{x} is rounded away from 0 to the left of the decima @CATEGORY=Mathematics @FUNCTION=SUMIFS @SHORTDESC=sum of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria @SYNTAX=SUMIFS(range1,criteria1,…) @ARGUMENTDESCRIPTION=@{range1}: cell area @SYNTAX=SUMIFS(actual_range,range1,criteria1,…) @ARGUMENTDESCRIPTION=@{actual_range}: cell area @{range1}: cell area @{criteria1}: condition for a cell to be included @EXCEL=This function is Excel compatible. @SEEALSO=SUM,SUMIF ... ...
 ... ... @@ -10762,10 +10762,11 @@ AVERAGEIFS(range1,criteria1,…) AVERAGEIFS(actual_range,range1,criteria1,…) Arguments actual_range: cell area range1: cell area criteria1: condition for a cell to be included ... ... @@ -12162,6 +12163,40 @@ MAXIFS MAXIFS maximum of the cells in actual_range for which the corresponding cells in the range meet the given criteria MAXIFS(actual_range,range1,criteria1,…) Arguments actual_range: cell area range1: cell area criteria1: condition for a cell to be included Microsoft Excel Compatibility This function is Excel compatible. See also MIN, MINIFS. ... ... @@ -12194,6 +12229,40 @@ MINIFS MINIFS minimum of the cells in actual_range for which the corresponding cells in the range meet the given criteria MINIFS(actual_range,range1,criteria1,…) Arguments actual_range: cell area range1: cell area criteria1: condition for a cell to be included Microsoft Excel Compatibility This function is Excel compatible. See also MIN, MAXIFS. ... ... @@ -13315,10 +13384,11 @@ SUMIFS(range1,criteria1,…) SUMIFS(actual_range,range1,criteria1,…) Arguments actual_range: cell area range1: cell area criteria1: condition for a cell to be included ... ...
 ... ... @@ -786,6 +786,7 @@ gnumeric_sumif (GnmFuncEvalInfo *ei, GnmValue const * const *argv) static GnmFuncHelp const help_sumifs[] = { { GNM_FUNC_HELP_NAME, F_("SUMIFS:sum of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria")}, { GNM_FUNC_HELP_ARG, F_("actual_range:cell area")}, { GNM_FUNC_HELP_ARG, F_("range1:cell area")}, { GNM_FUNC_HELP_ARG, F_("criteria1:condition for a cell to be included")}, { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") }, ... ... @@ -821,6 +822,7 @@ gnumeric_averageif (GnmFuncEvalInfo *ei, GnmValue const * const *argv) static GnmFuncHelp const help_averageifs[] = { { GNM_FUNC_HELP_NAME, F_("AVERAGEIFS:average of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria")}, { GNM_FUNC_HELP_ARG, F_("actual_range:cell area")}, { GNM_FUNC_HELP_ARG, F_("range1:cell area")}, { GNM_FUNC_HELP_ARG, F_("criteria1:condition for a cell to be included")}, { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") }, ... ... @@ -831,7 +833,46 @@ static GnmFuncHelp const help_averageifs[] = { static GnmValue * gnumeric_averageifs (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv) { return newstyle_if_func (ei, argc, argv, gnm_range_sum, GNM_ERROR_DIV0); return newstyle_if_func (ei, argc, argv, gnm_range_average, GNM_ERROR_DIV0); } /***************************************************************************/ static GnmFuncHelp const help_minifs[] = { { GNM_FUNC_HELP_NAME, F_("MINIFS:minimum of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria")}, { GNM_FUNC_HELP_ARG, F_("actual_range:cell area")}, { GNM_FUNC_HELP_ARG, F_("range1:cell area")}, { GNM_FUNC_HELP_ARG, F_("criteria1:condition for a cell to be included")}, { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") }, { GNM_FUNC_HELP_SEEALSO, "MIN,MAXIFS"}, { GNM_FUNC_HELP_END} }; static GnmValue * gnumeric_minifs (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv) { return newstyle_if_func (ei, argc, argv, gnm_range_min, GNM_ERROR_DIV0); } /***************************************************************************/ static GnmFuncHelp const help_maxifs[] = { { GNM_FUNC_HELP_NAME, F_("MAXIFS:maximum of the cells in @{actual_range} for which the corresponding cells in the range meet the given criteria")}, { GNM_FUNC_HELP_ARG, F_("actual_range:cell area")}, { GNM_FUNC_HELP_ARG, F_("range1:cell area")}, { GNM_FUNC_HELP_ARG, F_("criteria1:condition for a cell to be included")}, { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") }, { GNM_FUNC_HELP_SEEALSO, "MIN,MINIFS"}, { GNM_FUNC_HELP_END} }; static GnmValue * gnumeric_maxifs (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv) { return newstyle_if_func (ei, argc, argv, gnm_range_max, GNM_ERROR_DIV0); } /***************************************************************************/ ... ... @@ -3630,6 +3671,14 @@ GnmFuncDescriptor const math_functions[] = { NULL, gnumeric_averageifs, NULL, NULL, GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_NO_TESTSUITE }, { "minifs", NULL, help_minifs, NULL, gnumeric_minifs, NULL, NULL, GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_NO_TESTSUITE }, { "maxifs", NULL, help_maxifs, NULL, gnumeric_maxifs, NULL, NULL, GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_NO_TESTSUITE }, { "sumproduct", NULL, help_sumproduct, NULL, gnumeric_sumproduct, NULL, NULL, GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC }, ... ...
 ... ... @@ -65,7 +65,9 @@ ... ...
 ... ... @@ -12932,6 +12932,8 @@ oo_func_map_in (GnmConventions const *convs, Workbook *scope, { "HYPGEOM.DIST","HYPGEOMDIST" }, { "IFS","IFS" }, { "LOGNORM.INV","LOGINV" }, { "MINIFS", "MINIFS" }, { "MAXIFS", "MAXIFS" }, { "MODE.SNGL","MODE" }, { "MODE.MULT","MODE.MULT" }, { "NORM.DIST","NORMDIST" }, ... ...
 ... ... @@ -2479,6 +2479,7 @@ odf_expr_func_handler (GnmConventionsOut *out, GnmExprFunction const *func) { "MATCH","MATCH" }, { "MAX","MAX" }, { "MAXA","MAXA" }, { "MAXIFS","MAXIFS" }, { "MDETERM","MDETERM" }, { "MDURATION","MDURATION" }, { "MEDIAN","MEDIAN" }, ... ... @@ -2486,6 +2487,7 @@ odf_expr_func_handler (GnmConventionsOut *out, GnmExprFunction const *func) { "MIDB","MIDB" }, { "MIN","MIN" }, { "MINA","MINA" }, { "MINIFS","MINIFS" }, { "MINUTE","MINUTE" }, { "MINVERSE","MINVERSE" }, { "MIRR","MIRR" }, ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment