MM_SUMIFS function

Returns the sum of values of all dimensions or specified dimensions of a range that meet a chosen set of criteria.

Written By Nikolas Ethoré (Super Administrator)

Updated at November 29th, 2021

Description

Equivalent of SUMIFS Excel function. Returns the sum of values of all dimensions or specified dimensions of a range that meet a chosen set of criteria.

Syntax

=MM_SUMIFS(Sum_value, Range1, Condition1, [Range2, Condition2], [Range3, Condition3], ["Name", Index], ["Name2", Index2], ...)
  • Sum_value
    Cells to sum if the given set of criteria is met.

  • Range1
    Range to be tested for Condition1. 

  • Condition1
    The first criterion used to select which values to sum. Can be string, number or cell reference. Criterion that includes logical symbols (=, >, <) must be written as a string. Ex: ">0".
    Warning: If your version of Excel does not use English notation, be sure to use a decimal point for string criteria. For instance, write ">12.5" instead of ">12,5" as the cultural translation is not automatic for strings. 

  • Range2, Condition2 (optional)
    Range to be tested for Condition2 and second criterion.

  • Range3, Condition3 (optional)
    Range to be tested for Condition3 and third criterion.

  • "Name", Index (optional)
    String, Integer.
    Name of a loop and index of that same loop you want to access to sum values. If you do not specify any index for a loop, Mind takes all indexes for that loop.
    For stochastic dimension: if you want to sum the results of one specific simulation, you can specify "SIM" as Name and the desired simulation index under Index.
    Warning: If you specify loops, all first seven parameters should be input. Input empty strings ("") when needed as Mind does not accept empty parameters.

 Warning: The parameter LoopName is case sensitive.

  • "Name2", Index2, "Name3", Index3, ...etc. (optional)
    String, Integer.
    Names and indexes of other loops. 

Remarks

  • There is no point in using MM_SUMIFS, if Sum_value has no multiple dimensions; the function automatically returns Sum_value without applying the criteria. In that case, you must use SUMIFS Excel function.

  • You cannot specify the same loop with different dimensions. If you want to sum two different dimensions of the same loop, one possibility is to use twice the MM_RESULT function for each dimension and a SUMIFS Excel function. 

  • Remember to input Range2, Condition2, Range3 and Condition3 if you input Name, Index, Name2, Index 2, ...; use empty strings ("") if you have less than 3 criteria.

  • For MM_SUMIFS to work correctly, Sum_value and Range1, Range2, Range3 must have the same length and the same dimensions. If you use a range and not a single cell in your parameters, the cells of your range also need to have the same dimensions.

  • If the set of criteria is never met for the rangesthe function returns the value: 0.

  • See MM_SUMIF function‍ if you specify only one criterion.

  • See MM_RESULT function‍ to sum dimensions (from loops and simulations) without criteria.
    See MM_SUM function‍ to sum the results of stochastic simulations.

Example 1: No loop and simulations

Formula1: =MM_SUMIFS(A2,B2,">0.5"). Given the number of simulations in Mind, the formula returns the sum of the simulations in A2 for which cell B2 is greater than 0.5. If n=2 and the results in A2 and B2 are (0.8, 0.7) and (0.4, 0.51) respectively, then A3 returns 0.7.

Example 2: Two loops, no specified dimension

In this example, the cells D3 (name: Sum) and E3 (name: Product) depend on Loop1 and Loop2; they have 4 dimensions each. These cells correspond to the sum and the product of Loop1 and Loop2, respectively.

The formula :=MM_SUMIFS(Sum,Sum,">10",Product,">500") returns 95. Indeed, it is adding values of Sum for which Sum is greater than 10 and Product is greater than 500. In this case, it is adding 47 and 48, corresponding to the dimensions (Loop1,Loop2) = (2,1) and (Loop1,Loop2) = (2,2). Dimension results are shown below.

Example 3: Two loops, specified dimension

This example is similar to the one above but we choose to specify the index of the second loop. We set it to 1. Note that, in this case, all Range and Condition parameters must be input.

The formula: =MM_SUMIFS(Sum,Sum,">10",Product,">500","","","Loop2",1) returns 47. Indeed, in this case, we only take into account the first dimension of Loop2. Details are shown below.

Example 4: Loops and simulations

You can mix the first and second examples to sum cells with loop dimensions and stochastic dimensions.

Example 5: Error example, empty parameters

Formula: =MM_SUMIFS(Sum,Sum,">10",Product,">500",,,"Loop1",1)
Returns an error as Mind does not recognize empty parameters.

Example 6: Error example, ranges with different dimension sizes

Let us go back to example 2. For cell E3, instead of calculating the product, we choose E3=B5. Thus, cell D3 and E3 do not have the same dimension sizes. Indeed, D3 has two loops and E3 only has one. In that case, the formula does not make sense and Mind returns 0.

It is possible to force a value for cell E3 for dimensions of Loop1 so that the formula is calculated properly. See formula 4 in the MM_RESULT function‍ article.