Local clone of [PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet/)
Go to file
Owen Leibman 4f6d4af396
Save Excel 2010+ Functions Properly
For functions introduced in Excel 2010 and beyond, Excel saves them
in formulas with the xlfn_ prefix. PhpSpreadsheet does not do this;
as a result, when a spreadsheet so created is opened, the cells
which use the new functions display a #NAME? error.
This the cause of bug report 1246:
https://github.com/PHPOffice/PhpSpreadsheet/issues/1246
This change corrects that problem when the Xlsx writer encounters
a 2010+ formula for a cell or a conditional style. A new class
Writer/Xlsx/Xlfn, with 2 static methods,
is introduced to facilitate this change.

As part of the testing for this, I found some additional problems.
When an unknown function name is used, Excel generates a #NAME? error.
However, when an unknown function is used in PhpSpreadsheet:
  - if there are no parameters, it returns #VALUE!, which is wrong
  - if there are parameters, it throws an exception, which is horrible
Both of these situations will now return #NAME?
Tests have been added for these situations.

The MODE (and MODE.SNGL) function is not quite in alignment with Excel.
MODE(3, 3, 4, 4) returns 3 in both Excel and PhpSpreadsheet.
However, MODE(4, 3, 3, 4) returns 4 in Excel, but 3 in PhpSpreadsheet.
Both situations will now match Excel's result.
Also, Excel allows its parameters for MODE to be an array,
but PhpSpreadsheet did not; it now will.
There had not been any tests for MODE. Now there are.

The SHEET and SHEETS functions were introduced in Excel 2013,
but were not introduced in PhpSpreadsheet. They are now introduced
as DUMMY functions so that they can be parsed appropriately.

Finally, in common with the "rate" changes for which I am
creating a pull request at the same time as this one:
samples/Basic/13_CalculationCyclicFormulae
PhpUnit started reporting an error like "too much regression".
The test deals with an infinite cyclic formula, and allowed
the calculation engine to run for 100 cycles. The actual number of cycles
seems irrelevant for the purpose of this test. I changed it to 15,
and PhpUnit no longer complains.
2020-05-18 12:37:35 +09:00
.github Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
bin Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
docs Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
samples A few more invalid displayBlanksAs 2020-05-17 19:35:18 +09:00
src/PhpSpreadsheet Save Excel 2010+ Functions Properly 2020-05-18 12:37:35 +09:00
tests Save Excel 2010+ Functions Properly 2020-05-18 12:37:35 +09:00
.gitattributes Limit composer package to `src/` 2020-05-17 12:47:55 +09:00
.gitignore Move PHP-CS-Fixer cache file out of the project to avoid IDE annoyance 2018-10-21 15:34:33 +11:00
.php_cs.dist Take advantage of PHP 7.1 syntax 2019-07-24 23:43:28 -07:00
.scrutinizer.yml Revert "Accept no change of coverage" 2017-12-23 20:59:18 +09:00
.travis.yml Follow redirect to download phpDocumentor 2020-05-02 21:45:11 +09:00
CHANGELOG.PHPExcel.md Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
CHANGELOG.md Save Excel 2010+ Functions Properly 2020-05-18 12:37:35 +09:00
CONTRIBUTING.md `master` is the new default branch 2019-01-02 15:28:38 +11:00
LICENSE Change license from LGPL 2.1 to MIT 2019-11-17 18:08:34 +01:00
README.md README - add link to migration path to show people easier way (#1460) 2020-05-16 20:40:36 +09:00
composer.json Add maennchen/zipstream-php dependency 2020-04-27 21:26:54 +02:00
composer.lock Add maennchen/zipstream-php dependency 2020-04-27 21:26:54 +02:00
mkdocs.yml `master` is the new default branch 2019-01-02 15:28:38 +11:00
phpunit.xml.dist Use current PHPUnit configuration xsd 2020-05-17 18:38:49 +09:00

README.md

PhpSpreadsheet

Build Status Code Quality Code Coverage Total Downloads Latest Stable Version License Join the chat at https://gitter.im/PHPOffice/PhpSpreadsheet

PhpSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to read from and to write to different spreadsheet file formats, like Excel and LibreOffice Calc.

Documentation

Read more about it, including install instructions, in the official documentation. Or check out the API documentation.

Please ask your support questions on StackOverflow, or have a quick chat on Gitter.

PHPExcel vs PhpSpreadsheet ?

PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.).

Because all efforts have shifted to PhpSpreadsheet, PHPExcel will no longer be maintained. All contributions for PHPExcel, patches and new features, should target PhpSpreadsheet master branch.

Do you need to migrate? There is an automated tool for that.

License

PhpSpreadsheet is licensed under MIT.