modern-xlsx API Reference - v1.3.0
    Preparing search index...

    Function expandSharedFormula

    • Expand a shared formula from its master cell to a child cell.

      Relative references are shifted by the row/column difference between masterRef and childRef. Absolute references ($A$1) are preserved.

      Parameters

      • masterFormula: string

        The formula string in the master cell.

      • masterRef: string

        The master cell reference (e.g., "B1").

      • childRef: string

        The child cell reference (e.g., "B3").

      Returns string

      The expanded formula string for the child cell, or masterFormula unchanged when it does not parse or shifting it exhausts the call stack.

      INVALID_CELL_REF when masterRef or childRef is not an uppercase A1 reference inside A1:XFD1048576; shifts past the sheet edge never throw and give #REF!