 9b44cf3418
			
		
	
	
		9b44cf3418
		
			
		
	
	
	
	
		
			
			- Fix ISFORMULA() function to work with a cell reference to another worksheet
 - Added calculation engine support for the new functions that were added in MS Excel 2013 and MS Excel 2016
   - Text Functions
     - CONCAT()     Synonym for CONCATENATE()
     - NUMBERVALUE()  Converts text to a number, in a locale-independent way
     - UNICHAR()    Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
     - UNIORD()     Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
     - TEXTJOIN()   Joins together two or more text strings, separated by a delimiter
   - Logical Functions
     - XOR()        Returns a logical Exclusive Or of all arguments
   - Date/Time Functions
     - ISOWEEKNUM()  Returns the ISO 8601 week number of the year for a given date
   - Lookup and Reference Functions
     - FORMULATEXT()  Returns a formula as a string
   - Engineering Functions
     - ERF.PRECISE()   Returns the error function integrated between 0 and a supplied limit
     - ERFC.PRECISE()  Synonym for ERFC
   - Math and Trig Functions
     - SEC()          Returns the secant of an angle
     - SECH()         Returns the hyperbolic secant of an angle
     - CSC()          Returns the cosecant of an angle
     - CSCH()         Returns the hyperbolic cosecant of an angle
     - COT()          Returns the cotangent of an angle
     - COTH()         Returns the hyperbolic cotangent of an angle
     - ACOT()         Returns the cotangent of an angle
     - ACOTH()        Returns the hyperbolic cotangent of an angle
  - Financial Functions
    - PDURATION()    Calculates the number of periods required for an investment to reach a specified value
    - RRI()          Calculates the interest rate required for an investment to grow to a specified future value
		
	
			
		
			
				
	
	
		
			298 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			298 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| //  Date String, Result
 | |
| 
 | |
| return [
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         '25-Dec-1899',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         '31-Dec-1899',
 | |
|     ],
 | |
|     [
 | |
|         1,
 | |
|         '1-Jan-1900',
 | |
|     ],
 | |
|     [
 | |
|         59,
 | |
|         '1900/2/28',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         '29-02-1900',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         '29th February 1900',
 | |
|     ],
 | |
|     [
 | |
|         61,
 | |
|         '1900/3/1',
 | |
|     ],
 | |
|     [
 | |
|         713,
 | |
|         '13-12-1901',
 | |
|     ],
 | |
|     [
 | |
|         714,
 | |
|         '14-12-1901',
 | |
|     ],
 | |
|     [
 | |
|         1461,
 | |
|         '1903/12/31',
 | |
|     ],
 | |
|     [
 | |
|         1462,
 | |
|         '1-Jan-1904',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         1463,
 | |
|         '2nd-Jan-1904',
 | |
|     ],
 | |
|     [
 | |
|         22269,
 | |
|         '19-12-1960',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         25569,
 | |
|         '1st January 1970',
 | |
|     ],
 | |
|     [
 | |
|         30292,
 | |
|         '7-Dec-1982',
 | |
|     ],
 | |
|     [
 | |
|         39448,
 | |
|         '1-1-2008',
 | |
|     ],
 | |
|     [
 | |
|         50424,
 | |
|         '2038-01-19',
 | |
|     ],
 | |
|     [
 | |
|         39601,
 | |
|         '2-6-2008',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         39807,
 | |
|         'December 25th 2008',
 | |
|     ],
 | |
|     [
 | |
|         39448,
 | |
|         '1 Jan-2008',
 | |
|     ],
 | |
|     // MS Excel success or failure dependent on country settings
 | |
|     [
 | |
|         39813,
 | |
|         '12-31-2008',
 | |
|     ],
 | |
|     // PhpSpreadsheet tries to handle both US and UK formats, irrespective of country settings
 | |
|     [
 | |
|         39813,
 | |
|         '31-12-2008',
 | |
|     ],
 | |
|     // MS Excel success or failure dependent on country settings
 | |
|     [
 | |
|         39682,
 | |
|         '8/22/2008',
 | |
|     ],
 | |
|     // PhpSpreadsheet tries to handle both US and UK formats, irrespective of country settings
 | |
|     [
 | |
|         39682,
 | |
|         '22/8/2008',
 | |
|     ],
 | |
|     [
 | |
|         39682,
 | |
|         '22/8/08',
 | |
|     ],
 | |
|     [
 | |
|         39682,
 | |
|         '22-AUG-2008',
 | |
|     ],
 | |
|     [
 | |
|         39501,
 | |
|         '2008/02/23',
 | |
|     ],
 | |
|     [
 | |
|         39635,
 | |
|         '6-7-2008',
 | |
|     ],
 | |
|     // MS Excel success or failure dependent on country settings
 | |
|     [
 | |
|         39141,
 | |
|         '28-2-2007',
 | |
|     ],
 | |
|     // PhpSpreadsheet tries to handle both US and UK formats, irrespective of country settings
 | |
|     [
 | |
|         39141,
 | |
|         '2-28-2007',
 | |
|     ],
 | |
|     // Should fail because it's an invalid date, but PhpSpreadsheet currently adjusts to 1-3-2007 - FIX NEEDED
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         '29-2-2007',
 | |
|     ],
 | |
|     [
 | |
|         36161,
 | |
|         '1/1/1999',
 | |
|     ],
 | |
|     [
 | |
|         19925,
 | |
|         '1954-07-20',
 | |
|     ],
 | |
|     [
 | |
|         36029,
 | |
|         '22 August 98',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         39142,
 | |
|         '1st March 2007',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         'The 1st day of March 2007',
 | |
|     ],
 | |
|     // 01/01 of the current year
 | |
|     [
 | |
|         43101,
 | |
|         '1 Jan',
 | |
|     ],
 | |
|     // 31/12 of the current year
 | |
|     [
 | |
|         43465,
 | |
|         '31/12',
 | |
|     ],
 | |
|     // Excel reads as 1st December 1931, not 31st December in current year
 | |
|     [
 | |
|         11658,
 | |
|         '12/31',
 | |
|     ],
 | |
|     // 05/07 of the current year
 | |
|     [
 | |
|         43286,
 | |
|         '5-JUL',
 | |
|     ],
 | |
|     // 05/07 of the current year
 | |
|     [
 | |
|         43286,
 | |
|         '5 Jul',
 | |
|     ],
 | |
|     [
 | |
|         39783,
 | |
|         '12/2008',
 | |
|     ],
 | |
|     [
 | |
|         11963,
 | |
|         '10/32',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         11,
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         true,
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         false,
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         1,
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         12345,
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         12,
 | |
|     ],
 | |
|     [
 | |
|         40221,
 | |
|         '12-Feb-2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40221,
 | |
|         'Feb-12-2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40221,
 | |
|         'February-12-2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40221,
 | |
|         'February 12 2010',
 | |
|     ],
 | |
|     [
 | |
|         40227,
 | |
|         '18 Feb 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40254,
 | |
|         '17th 3rd 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40227,
 | |
|         'Feb 18th 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40210,
 | |
|         '1st Feb 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40210,
 | |
|         '1st-Feb-2010',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         '1me Fev 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40210,
 | |
|         'February 1st 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40211,
 | |
|         '2nd Feb 2010',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         'Second Feb 2010',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         'First August 2010',
 | |
|     ],
 | |
|     // MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
 | |
|     [
 | |
|         40391,
 | |
|         '1st August 2010',
 | |
|     ],
 | |
|     [
 | |
|         0,
 | |
|         '15:30:25',
 | |
|     ],
 | |
|     [
 | |
|         '#VALUE!',
 | |
|         'ABCDEFGHIJKMNOPQRSTUVWXYZ',
 | |
|     ],
 | |
| ];
 |