$worksheet->write_fromula('A1', '=2+2', $format, 4); # Or: $worksheet->write('A1', '=2+2', $format, 4);