formula() {
        return new ArgHandler("Range.formula")
            .case(() => {
                return this.startCell().getSharedRefFormula();
            })
            .case('string', formula => {
                const sharedFormulaId = this.sheet().incrementMaxSharedFormulaId();
                this.forEach((cell, ri, ci) => {
                    if (ri === 0 && ci === 0) {
                        cell.setSharedFormula(sharedFormulaId, formula, this.address());
                    } else {
                        cell.setSharedFormula(sharedFormulaId);
                    }
                });

                return this;
            })
            .handle(arguments);
    }
Sets the shared formula in the range. The formula will be translated for each cell.
@param {string} formula - The formula to set.
@returns {Range} The range.