setFormula method

void setFormula(
  1. String formula
)

Helps to set the formula

var sheet = excel['Sheet1'];
var cell = sheet.cell(CellIndex.indexByString("E5"));
cell.setFormula('=SUM(1,2)');

Implementation

void setFormula(String formula) {
  _sheet.updateCell(cellIndex, Formula.custom(formula));
}