Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPExcel Fatal error: Uncaught exception 'Exception' with message 'Formula Error: Unexpected ,'
    text
    copied!<p>I have searched on google but i could not find any solution for this.<br> What i'm trying to do is making a excel5 export file from a report with php. </p> <p>Whenever i try to make a average of times i getting the following error:</p> <pre><code>Fatal error: Uncaught exception 'Exception' with message 'myexcelsheet!F38 -&gt; Formula Error: Unexpected ,' </code></pre> <p>This is the formula that gives the error:</p> <pre><code>=SUM(F9:F36)/COUNTIF(F9:F36, "*" &amp; "&lt;&gt;00:00:00" &amp; "*") </code></pre> <p>The cell data types are Time. With a COUNT it works fine but it needs to ignore the 00:00:00 times.</p> <p>This are the includes:</p> <pre><code>require_once("PHPExcel/Classes/PHPExcel.php"); require_once("PHPExcel/Classes/PHPExcel/Writer/Excel5.php"); require_once 'PHPExcel/Classes/PHPExcel/Cell/AdvancedValueBinder.php'; </code></pre> <p>Whole Error:</p> <pre><code>Fatal error: Uncaught exception 'Exception' with message 'myexcelsheet!F38 -&gt; Formula Error: Unexpected ,' in /path/to/PHPExcel/Classes/PHPExcel/Cell.php:293 Stack trace: #0 /path/to/PHPExcel/Classes/PHPExcel/Worksheet.php(702): PHPExcel_Cell-&gt;getCalculatedValue() #1 /path/to/PHPExcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php(295): PHPExcel_Worksheet-&gt;calculateColumnWidths() #2 /path/to/PHPExcel/Classes/PHPExcel/Writer/Excel5.php(194): PHPExcel_Writer_Excel5_Worksheet-&gt;close() #3 /path/to/rep-functions.php(985): PHPExcel_Writer_Excel5-&gt;save('/path/t...') #4 /path/to/report.php(462): export_excel(Array, Array, 'report.ph...', Array, Array, Array) #5 {main} thrown in /path/to/PHPExcel/Classes/PHPExcel/Cell.php on line 293 </code></pre> <p>This is what i get from the testFormula function</p> <pre> Formula Value is=SUM(F9:F36)/COUNTIF(F9:F36,"*" & "00:00:00" & "*") Expected Value is UNKNOWN Parser Stack :- Array ( [0] => Array ( [type] => Cell Reference [value] => F9 [reference] => F9 ) [1] => Array ( [type] => Cell Reference [value] => F36 [reference] => F36 ) [2] => Array ( [type] => Binary Operator [value] => : [reference] => ) [3] => Array ( [type] => Operand Count for Function SUM() [value] => 1 [reference] => ) [4] => Array ( [type] => Function [value] => SUM( [reference] => ) [5] => Array ( [type] => Cell Reference [value] => F9 [reference] => F9 ) [6] => Array ( [type] => Cell Reference [value] => F36 [reference] => F36 ) [7] => Array ( [type] => Binary Operator [value] => : [reference] => ) [8] => Array ( [type] => Value [value] => "*" [reference] => ) [9] => Array ( [type] => Value [value] => "00:00:00" [reference] => ) [10] => Array ( [type] => Binary Operator [value] => & [reference] => ) [11] => Array ( [type] => Value [value] => "*" [reference] => ) [12] => Array ( [type] => Binary Operator [value] => & [reference] => ) [13] => Array ( [type] => Operand Count for Function COUNTIF() [value] => 2 [reference] => ) [14] => Array ( [type] => Function [value] => COUNTIF( [reference] => ) [15] => Array ( [type] => Binary Operator [value] => / [reference] => ) ) CALCULATION ENGINE ERROR: Worksheet!F38 -> Formula Error: Unexpected , Evaluation Log: Array ( ) </pre> <p>Let me know if you need more information.</p> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload