MM_ROW function

Returns a row range starting from a given cell and ending at the last column of the corresponding table. Used for dynamic tables.

Written By Nikolas Ethoré (Super Administrator)

Updated at November 29th, 2021

Description

Returns a row range starting from a given cell and ending at the last column of the corresponding table. Used for dynamic tables. In Excel, it returns a row range starting from the specified cell and ending at the first empty cell (excluded). 

Syntax

=MM_ROW(Cell)
  • Cell
    Starting cell of the row.

Remarks

  • Warning: This formula has a different behavior in Excel and in Mind. See the first example. 

  • This function is useful when you have dynamic tables, i.e. when the size of your table varies, for instance, if you use the input manager, interlinks, or dynamic instances. 

  • See MM_COLUMN function to return a column range. 

Example 1: Summing the cells of one row

Notice that the cell C4 is empty. Keep in Mind that the function has a different behavior in Excel and in Mind.

In Excel, the formula :=SUM(MM_ROW(B4)) returns 41 as MM_ROW(B4) stops at the first empty cell starting from the input cell B4. To be more precise, MM_ROW(B4) is exactly equal to the reference B4 in Excel. 

In Mind, the spreadsheet is divided by defined tables. The function MM_ROW(B4) returns the third row of the #Data table starting from B4. Thus, the entire formula returns the sum of the third row which is 55.

The benefit is that if you add 10 more assumptions, you do not need to change the formula in A7. 

Example 2: Defining dynamic instances

Prerequisite knowledge: read the article "managing models" to learn about instances.

The formula :=MM_LOOP("Loop"&MM_INSTINDEX(),MM_ROW(A3)) enables to define a loop specific for each instance. In this case, "Loop1" is specific to the first instance, "Loop2" to the second instance, and so on (of course, instances should be added beforehand and assumptions imported for each instance). What is interesting here is that the range of each loop is defined with MM_ROW(A3), which means that the loops can be of different lengths. For example, you can have 5 scenarios for the first instance and 3 scenarios for the second instance.