Problem with the formula ROUND

Topics: Developer Forum, User Forum
Jan 4, 2013 at 12:55 PM

Hello

I want to put in a cell of the formula

"=ROUND(ROUND(M'.$idexcel.';0)*0.13;0)+ROUNDDOWN(M'.$idexcel.'*2/1500;0)';"
idexcel with number corresponding to the line.
When I put out this function I get an error

<b>Fatal error</b>:  Uncaught exception 'PHPExcel_Exception' with message 'Worksheet!C261 -> Formula Error: An unexpected error occured' in /home/www/ciigpeu/ciigpshop/tools/phpexcels/PHPExcel/Cell.php:307
Stack trace:
#0 /home/www/ciigpeu/ciigpshop/tools/phpexcels/PHPExcel/Writer/Excel2007/Worksheet.php(1077): PHPExcel_Cell->getCalculatedValue()
#1 /home/www/ciigpeu/ciigpshop/tools/phpexcels/PHPExcel/Writer/Excel2007/Worksheet.php(1023): PHPExcel_Writer_Excel2007_Worksheet->_writeCell(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel_Worksheet), 'C261', Array, Array)
#2 /home/www/ciigpeu/ciigpshop/tools/phpexcels/PHPExcel/Writer/Excel2007/Worksheet.php(83): PHPExcel_Writer_Excel2007_Worksheet->_writeSheetData(Object(PHPExcel_Shared_XMLWriter), Object(PHPExcel_Worksheet), Array)
#3 /home/www/ciigpeu/ciigpshop/tools/phpexcels/PHPExcel/Writer/Excel2007.php(282): PHPExcel_Writer_Excel2007_Worksheet->writeWorksheet(Object(PHPExcel_Worksheet), Array, false)
#4 /home/www/ciigpeu/ciigpshop/modules/boCommandExporter/controllers/admin/Ad in <b>/home/www/ciigpeu/ciigpshop/tools/phpexcels/PHPExcel/Cell.php</b> on line <b>307</b><br />
You must be doing something special for the use formula. Knowing that I made ​​a
$ objPHPExcel-> getActiveSheet () -> setCellValue (..)

of the formula

If anyone can help me on the subject I'm interested because I do not understand why this error.

Coordinator
Jan 5, 2013 at 12:15 AM

Use comma (,) for function argument separators rather than semi-colon (;) as per English format; and no trailing ; in the formula either

"=ROUND(ROUND(M'.$idexcel.',0)*0.13,0)+ROUNDDOWN(M'.$idexcel.'*2/1500,0)'"

Jan 5, 2013 at 11:30 AM

Thank you it worked.