I am using a German Excel Version and wrote following formula into Cell AM27:
=WENNFEHLER(AN61/(AN$61+AN$62+AN$63);"")
This correspondends to the English formular:
=iferror(AM61/(AM$61+AM$62+AM$63),"")
Now I am loading and saving the file with PHPExcel and get this exception:
PHPExcel_Calculation_Exception: MySheetName!AN27 -> Formula Error: Unexpected ,
My questions are
Thanks for your help!
Section 4.6.4 of the developer documentation:
When writing a formula to a cell:
.
(period),
(comma);
(semicolon)e.g.
$objPHPExcel->getActiveSheet()
->setCellValue(
'AM27',
'=IFERROR(AM61/(AM$61+AM$62+AM$63),"")'
);
If you want to write formulae using German language function names and separators, you need to use the locale functions to handle translation between German and English (as described in section 4.6.5 of the developer documentation):
$locale = 'de';
$validLocale = PHPExcel_Settings::setLocale($locale);
$objPHPExcel->getActiveSheet()
->setCellValue(
'AM27',
PHPExcel_Calculation::getInstance()
->translateFormulaToEnglish(
'=WENNFEHLER(AM61/(AM$61+AM$62+AM$63);"")'
)
);