formula property

String? get formula

Represent the range formula.

Implementation

String? get formula {
  if (isSingleRange) {
    return _formula;
  } else {
    return getFormula();
  }
}
set formula (String? value)

Sets the range formula.

Workbook workbook = new Workbook();
Worksheet sheet = workbook.worksheets[0];
Range range = sheet.getRangeByName('C1');
range.formula = '=A1+B1';
List<int> bytes = workbook.saveAsStream();
File('Formula.xlsx').writeAsBytes(bytes);
workbook.dispose();

Implementation

set formula(String? value) {
  setFormula(value);
}