Did you mean this LEFT function of Excel?
Excel:
LEFT("string", 3)
PHP:
substr("string", 0, 3);
If you want to add another column then add another array element to
$rec in csv_export.php.
$rec[] = substr($r['field'], 0, 3);
Is this what you mean to do?
If you want to return formula string "=LEFT(<cell ref>, param)", then i don't have enough knowledge about excel how to refer same row, but other column.
Regards,
Adam