countifs function with multiple conditions in excel file causes phpExcel to crash - php

I'm using phpExcel class in a project.
I created a model file with some formulas in its 2nd sheet which takes the data from 1st sheet. I'm writing all the data in the first sheet with phpExcel. Most of the formulas are working very well but there is one formula that causes a problem which is
=COUNTIFS(data!$R$2:$R$2000;"<>0";data!$R$2:$R$2000;"<=90")
for the Excel 2007, the syntax differs in newer verison of Excel like
=COUNTIFS(data!$R$2:$R$2000,"<>0",data!$R$2:$R$2000,"<=90")
I tried to write both formula to the cell with phpExcel also but it didn't work either. When I use this formula , I get no error or feedback , the script just stops working.
I would be glad if you could show me a way to solve this issue.
Regards

From the FunctionListByName.txt document in the PHPExcel /Documentation folder:
COUNTIFS CATEGORY_STATISTICAL *** Not yet Implemented

Related

php output sql to excel

How can I use php sql to export to Excel and NOT csv/tsv?
I have googled for it for a while but am only finding multiple results on exporting to csv.
Even if you just point me to the name of the method I can google it from there.
Thanks
You can use a lib like phpExcel or Spout to create (and read) excel files.
phpExcel : lots of options, but slow
spout : less options, but much faster than phpExcel

PHPExcel Crash with getCalculatedValue

I've been using PHPExcel for about a year to import data from spreadsheets in random cells. The code looks like this:
$value1 = test_input($objPHPExcel->getActiveSheet()->getCell('B13')->getCalculatedValue());
Recently, I changed the Excel sheets to run a more complex formula. The basic premise is that the sheet pulls data from a mySQL DB, which in turn is used in vlookups based on a dropdown to populate several fields. All relevant fields across the workbook are referenced on a final sheet for importing into the DB.
The problem now is that PHPExcel is crashing (diagnosing in NetBeans) when it comes to the cells with these calculated formulas. It works fine with most formulas, but when referencing cells which reference the cells with if > vlookup > ODBC link to mySQL, it crashes the program and stops the file import. Should I be using a different function, or what is causing it not to return the value?
Thanks in advance...

phpexcel with Bloomberg

I am trying to create an Excel workbook using PHPExcel...
Everything works fine with most of the columns I'm creating.
However, the last column contains a formula (BDH) which belongs to Bloomberg's Excel Addin. This workbook will be used, of course, on a Bloomberg Terminal.
PHPExcel returns an error when I try to enter the Bloomberg formula on this column. I have successfully entered regular formulas in the column, so I assume the problem is that PHPExcel doesn't know the Bloomberg formula I am entering...
Any thoughts?
$Formula="=BDH(\"$My_Asset\" , \"px_last\" , \"$My_Date\" , \"$My_Date\" , \"$My_Overrides\" )";
$objPHPExcel->setActiveSheetIndex(0)->setCellValue("G1",$Formula);
Thanks in advance!
You're correct in your assumption: PHPExcel will only work with functions that are "native" to Excel itself, not with functions that are added to Excel through external packs, nor with User-Defined functions. Nor is there any method of adding these non-native functions.

Date calculation with PHPExcel library

I have a php script that have to parse an excel file with some date and time to import in my mysql database
Screen of the xlsx file :
I'm using the PHPExcel library to read the file
When I get the cell value with getValue() method, it returns the formula =J4+"01:00:00" as showed in the excel formula field. Ok normal
When I use the the getCalculatedValue() method, it returns "#VALUE!". As excell / Libreoffice don't have any problem to calculate the formulas, I have no idea why the PHPExcel library is not able to calculate this quite simple formulas.
Do anyone had the same issue and know a trick to fix this issue ? Or do I realy have to tell users not use any formulas fort date fields type ?
I found the answer from the PHPExcel support platform.
The only way to manage this kind of formulase (date operation) is to replace my actual formulas by something like =J4+(1/24)
Source : PhpExcel support plateform

Adding Macro on Excel XML-specification to generate a native

I'm exporting data in excel sheet via drupal view. Drupal views_export_xls module uses
http://code.google.com/p/php-excel/source/browse/branches/class-excel-xml.inc.php?r=9
library to export data into excel sheet. Every thing working fine. But i want little more from it.
How to add MACRO in excel sheet row or cell programmatically?
Is it possible to do so by php code?
If you look at above link - line no 88 & 93 which actually create cells and rows.
What i want to create a macro and place it on excel sheet that can later convert this generated excel file into native xml (.in) file for business purpose.
I've searched a lot but most of the link suggesting VB solution and i've no sense about this language.
Can anyone point me on right direction.
Any help would be greatly appreciated!
As far as I'm aware, unless the Excel writer that you're using is based around COM, then there is no way of creating a Macro in an Excel workbook.

Categories