Use the method write_stringdirectly instead of using write:
$ws->write_string('A1', '=ABC()');
The table method :: WriteExcel write is a convenience method that guesses what data you are trying to save. If it is wrong, you should use one of the type methods.
source
share