Function shiftFormula

  • A formula copied by dRow rows and dCol columns (fill handle, copy and paste): relative references move, $ parts stay; a reference that leaves the sheet becomes #REF!. Formula text without =.

    Parameters

    • source: string

      the formula (without =)

    • dRow: number

      rows moved

    • dCol: number

      columns moved

    Returns string

    the moved formula (canonical text)

    Example

    shiftFormula("B2*C2+$F$1", 1, 0);   // "B3*C3+$F$1"
    shiftFormula("A1", -1, 0); // "#REF!"

    Since

    1.1.99