Eroor in Calculation.php

Topics: User Forum
Jan 21, 2013 at 9:17 AM

I'm pretty new to PHPExcel and I encountered an Error. It says that there is no offset 2 in Calculation.php on Line 2859. I Searched it up and it seems to be the startmatch variable that has no 2nd offset. I tracked the whole process of calculating a formula(yes that is what I want to do) and it showed that I can't figure why it fails right there.

The Formula I want to parse is: =IF(SUM(B10:BA10)=13;"OK";"?")

Can someone of you help me?

I thank you in advance


Jan 21, 2013 at 9:43 AM

As per the documentation: unless you're using one of the locale packs for locale-specific settings, then a comma (,) rather than a semi-colon (;) should be used as the separator for function arguments. When in doubt, en_us rules apply for all formulae.

Jan 21, 2013 at 10:00 AM
Edited Jan 21, 2013 at 10:01 AM

Thanks for your answer but this doesn't seem to be the solution

I changed what you suggested but the error remains

Notice: Undefined offset: 2 in C:\xampp\htdocs\UKFB\Classes\PHPExcel\Calculation.php on line 2859

The changed Formula:  =IF(SUM(B10:BA10)=13,"OK","?")

Jan 21, 2013 at 10:34 AM

I Found my fault

I wasn't thinking about the fact that PHP Excel was written in English. I used the german Formulas. Exchange them with English ones and it works liek a charm.

Thanks for your support



Jan 21, 2013 at 1:03 PM
Edited Jan 21, 2013 at 1:10 PM

The real reason is that MS Excel uses English formulas internally, it's the MS Excel GUI that handles conversion to language-specific variants. PHPExcel does replicate this functionality with locale settings for the calculation engine, so you can use formulae in German and with a ; rather than a , but only if you tell PHPExcel that your locale is german.


Section 4.6.5 of the Developer Documentation:

$locale = 'de';
$validLocale = PHPExcel_Settings::setLocale($locale);
if (!$validLocale) {
       echo 'Unable to set locale to '.$locale." - reverting to en_us<br />\n";


$formula = '=WENN(SUMME(B10:BA10)=13;"OK";"?")';
$internalFormula =