Namespace EasyXLS

Class ExcelArrayFormula


  • public class ExcelArrayFormula
    extends System.Object
    This class describes a formula that was array-entered into a range of cells. The range of cells in which the array is entered is defined by the firstRow, lastRow, firstCol, and lastCol fields.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExcelArrayFormula()
      Defines an empty instance of the array formula
      ExcelArrayFormula​(int firstRow, int firstCol, int lastRow, int colLast, System.String sFormula)
      Defines an instance of the array formula
      ExcelArrayFormula​(System.String range, System.String sFormula)
      Defines an instance of the array formula having the specified range and formula restrictions.
    • Method Summary

      Modifier and Type Method Description
      ExcelArrayFormula Clone()
      Creates and returns a copy of this object.
      int getColsNumber()
      Returns the number of columns in the range
      int getFirstColumn()
      Returns the first column in the range
      int getFirstRow()
      Returns the first row in the range
      System.String getFormula()
      Returns the formula of the array.
      int getLastColumn()
      Returns the last column in the range
      int getLastRow()
      Returns the last row in the range
      int getRowsNumber()
      Returns the number of rows in the range
      bool IsFirstCellInRange​(int nRow, int nCol)
      Internal use only.
      void setFormula​(System.String formula)
      Sets the formula of the array.
    • Constructor Detail

      • ExcelArrayFormula

        public ExcelArrayFormula()
        Defines an empty instance of the array formula
      • ExcelArrayFormula

        public ExcelArrayFormula​(int firstRow,
                                 int firstCol,
                                 int lastRow,
                                 int colLast,
                                 System.String sFormula)
        Defines an instance of the array formula
        Parameters:
        firstRow - the first row of the range where the array formula is entered
        firstCol - the first column of the range where the array formula is entered
        lastRow - the last row of the range where the array formula is entered
        colLast - the last column of the range where the array formula is entered
        sFormula - the formula entered as an array; it should start with = (an equal sign) and can be any kind of formula recognized by Excel
      • ExcelArrayFormula

        public ExcelArrayFormula​(System.String range,
                                 System.String sFormula)
        Defines an instance of the array formula having the specified range and formula restrictions.
        Parameters:
        range - the area location of the array formula. It can only be a range of cells (e.g. A1:B2).
        sFormula - the formula entered as an array; it should start with = (an equal sign) and can be any kind of formula recognized by Excel
    • Method Detail

      • getFirstRow

        public int getFirstRow()
        Returns the first row in the range
        Returns:
        the first row in the range
      • getLastRow

        public int getLastRow()
        Returns the last row in the range
        Returns:
        the last row in the range
      • getFirstColumn

        public int getFirstColumn()
        Returns the first column in the range
        Returns:
        the first column in the range
      • getLastColumn

        public int getLastColumn()
        Returns the last column in the range
        Returns:
        the last column in the range
      • getRowsNumber

        public int getRowsNumber()
        Returns the number of rows in the range
        Returns:
        the last column in the range
      • getColsNumber

        public int getColsNumber()
        Returns the number of columns in the range
        Returns:
        the number of columns in the range
      • getFormula

        public System.String getFormula()
        Returns the formula of the array.
        Returns:
        the formula of the array
        See Also:
        setFormula(System.String)
      • setFormula

        public void setFormula​(System.String formula)
        Sets the formula of the array. The formula must start with "=" symbol.
        Parameters:
        formula - the array formula
        See Also:
        getFormula()
      • IsFirstCellInRange

        public bool IsFirstCellInRange​(int nRow,
                                          int nCol)
        Internal use only. Returns whether or not the cell defined by the specified row and column is the first cell from array formula range
        Parameters:
        nRow - the row number of the cell
        nCol - the column number of the cell
        Returns:
        true if the cell at nRow and nCol is the first cell from array formula range
      • Clone

        public ExcelArrayFormula Clone()
        Creates and returns a copy of this object.
        Returns:
        a clone of this instance.