MM_LASTCOLUMN function

Returns the index of the last column of a grid from one of its cells. Used for dynamic tables.

Written By Nikolas Ethoré (Super Administrator)

Updated at November 24th, 2021

Description

Returns the index of the last column of a grid from one of its cells. In Excel, it returns the index of the column of the first empty cell minus 1, starting from the specified cell. Used for dynamic tables.

Syntax

=MM_LASTCOLUMN(Cell)
  • Cell
    Any cell inside the grid from which you want to get the index of the last column.

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_LASTROW to return the index of the last row. 

Example 1 

Formula:=MM_LASTCOLUMN(A3) returns 4 in Mind. Indeed the last column of the grid is column D, which corresponds to the fourth column.
In Excel, the function returns 2 because the first empty cell of the table is in column C. Thus, it returns the index of column B, which is 2. 

Example 2 

If your table begins at column G, the function returns the index of column J (in Mind), which is 10.