Set explicit value of a cell (alphabet coordinate)

By data type

if($field[3] == 'int'){
	$sheet->setCellValue($coordinate, $value);
}elseif($field[3] == 'date'){
	$sheet->setCellValue($coordinate, $value);

	$sheet->getStyle($coordinate)
		->getNumberFormat()
		->setFormatCode(
			\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME
		);
}else{
	$sheet->setCellValueExplicit(
		$coordinate,
		$value,
		\PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING
	);
}

https://phpspreadsheet.readthedocs.io/en/latest/topics/accessing-cells/