Now I have got an other issue. I am trying to set the following formula for a cell.
But it gives me an error. When I put the same in the excel sheet, it is accepted properly. Please let me know if PHPExcel is alright with using COUNTIFS for formulas.
The COUNTIFS() function is not currently supported. There are two files in the /Documentation folder -- FunctionListByName.txt and FunctionListByCategory.txt -- that list all of the Excel functions, and whether or not they are currently implemented.
At present, when saving a file using the Excel2007 or Excel5 Writers, PHPExcel saves both the formula and the calculated result... so calculating the result for a formula that contains a function that isn't implemented will result in an error. You can disable
this pre-calculation by setting $objWriter->setPreCalculateFormulas(false); befor eyou save. When the saved file is then opened in Excel, it may automatically recalcuate all formulae, might prompt the user to recalculate, or (worst case) not let the
user know that a recalculation is necessary and display invalid values in those cells (that's why we try to precalculate when we can).
Other writers, such as CSV, HTML and PDF require formulas to be calculated within PHPExcel so that the correct result can be rendered; so disabling precalculation is not an option.
Note also that the Excel5 Writer doesn't allow formulae containing functions that aren't part of the Excel5 core set, so Analysis Toolkit functions are not supported.