Skip to content

Commit 9b44cf3

Browse files
author
Mark Baker
authored
Add further new Functions introduced in MS Excel 2013 and 2016 (#608)
- 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
1 parent 3028c60 commit 9b44cf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2258
-118
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- Add excel function EXACT(value1, value2) support - [595](https://github.com/PHPOffice/PhpSpreadsheet/pull/595)
1313
- Support workbook view attributes for Xlsx format - [#523](https://github.com/PHPOffice/PhpSpreadsheet/issues/523)
1414
- Read and write hyperlink for drawing image - [#490](https://github.com/PHPOffice/PhpSpreadsheet/pull/490)
15+
- Fix ISFORMULA() function to work with a cell reference to another worksheet
16+
- Added calculation engine support for the new functions that were added in MS Excel 2013 and MS Excel 2016
17+
- Text Functions
18+
- CONCAT() Synonym for CONCATENATE()
19+
- NUMBERVALUE() Converts text to a number, in a locale-independent way
20+
- UNICHAR() Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
21+
- UNIORD() Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
22+
- TEXTJOIN() Joins together two or more text strings, separated by a delimiter
23+
- Logical Functions
24+
- XOR() Returns a logical Exclusive Or of all arguments
25+
- Date/Time Functions
26+
- ISOWEEKNUM() Returns the ISO 8601 week number of the year for a given date
27+
- Lookup and Reference Functions
28+
- FORMULATEXT() Returns a formula as a string
29+
- Financial Functions
30+
- PDURATION() Calculates the number of periods required for an investment to reach a specified value
31+
- RRI() Calculates the interest rate required for an investment to grow to a specified future value
32+
- Engineering Functions
33+
- ERF.PRECISE() Returns the error function integrated between 0 and a supplied limit
34+
- ERFC.PRECISE() Synonym for ERFC
35+
- Math and Trig Functions
36+
- SEC() Returns the secant of an angle
37+
- SECH() Returns the hyperbolic secant of an angle
38+
- CSC() Returns the cosecant of an angle
39+
- CSCH() Returns the hyperbolic cosecant of an angle
40+
- COT() Returns the cotangent of an angle
41+
- COTH() Returns the hyperbolic cotangent of an angle
42+
- ACOT() Returns the cotangent of an angle
43+
- ACOTH() Returns the hyperbolic cotangent of an angle
1544

1645
### Fixed
1746

docs/references/function-list-by-category.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ DAYS360 | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DAYS360
4141
EDATE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EDATE
4242
EOMONTH | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EOMONTH
4343
HOUR | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::HOUROFDAY
44+
ISOWEEKNUM | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::ISOWEEKNUM
4445
MINUTE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MINUTE
4546
MONTH | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MONTHOFYEAR
4647
NETWORKDAYS | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::NETWORKDAYS
@@ -73,7 +74,9 @@ DEC2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOHE
7374
DEC2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOOCT
7475
DELTA | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DELTA
7576
ERF | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERF
77+
ERF.PRECISE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFPRECISE
7678
ERFC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC
79+
ERFC.PRECISE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC
7780
GESTEP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::GESTEP
7881
HEX2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOBIN
7982
HEX2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTODEC
@@ -137,6 +140,7 @@ ODDFPRICE | **Not yet Implemented**
137140
ODDFYIELD | **Not yet Implemented**
138141
ODDLPRICE | **Not yet Implemented**
139142
ODDLYIELD | **Not yet Implemented**
143+
PDURATION | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PDURATION
140144
PMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PMT
141145
PPMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PPMT
142146
PRICE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICE
@@ -145,6 +149,7 @@ PRICEMAT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICEMAT
145149
PV | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PV
146150
RATE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RATE
147151
RECEIVED | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RECEIVED
152+
RRI | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RRI
148153
SLN | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SLN
149154
SYD | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SYD
150155
TBILLEQ | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLEQ
@@ -169,6 +174,7 @@ ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_BLANK
169174
ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR
170175
ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR
171176
ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN
177+
ISFORMULA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ISFORMULA
172178
ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL
173179
ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA
174180
ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT
@@ -184,13 +190,14 @@ TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE
184190

185191
Excel Function | PhpSpreadsheet Function
186192
--------------------|-------------------------------------------
187-
AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_AND
193+
AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd
188194
FALSE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::FALSE
189195
IF | \PhpOffice\PhpSpreadsheet\Calculation\Logical::STATEMENT_IF
190196
IFERROR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFERROR
191197
NOT | \PhpOffice\PhpSpreadsheet\Calculation\Logical::NOT
192-
OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_OR
198+
OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalOr
193199
TRUE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::TRUE
200+
XOR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalXor
194201

195202
## CATEGORY_LOOKUP_AND_REFERENCE
196203

@@ -201,8 +208,9 @@ AREAS | **Not yet Implemented**
201208
CHOOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CHOOSE
202209
COLUMN | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMN
203210
COLUMNS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMNS
211+
FORMULATEXT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::FORMULATEXT
204212
GETPIVOTDATA | **Not yet Implemented**
205-
HLOOKUP | **Not yet Implemented**
213+
HLOOKUP | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HLOOKUP
206214
HYPERLINK | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HYPERLINK
207215
INDEX | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX
208216
INDIRECT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT
@@ -222,6 +230,8 @@ Excel Function | PhpSpreadsheet Function
222230
ABS | abs
223231
ACOS | acos
224232
ACOSH | acosh
233+
ACOT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOT
234+
ACOTH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOTH
225235
ASIN | asin
226236
ASINH | asinh
227237
ATAN | atan
@@ -231,6 +241,10 @@ CEILING | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CEILING
231241
COMBIN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COMBIN
232242
COS | cos
233243
COSH | cosh
244+
COT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COT
245+
COTH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COTH
246+
CSC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CSC
247+
CSCH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CSCH
234248
DEGREES | rad2deg
235249
EVEN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN
236250
EXP | exp
@@ -261,6 +275,8 @@ ROMAN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROMAN
261275
ROUND | round
262276
ROUNDDOWN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDDOWN
263277
ROUNDUP | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDUP
278+
SEC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SEC
279+
SECH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SECH
264280
SERIESSUM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SERIESSUM
265281
SIGN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SIGN
266282
SIN | sin
@@ -270,7 +286,7 @@ SQRTPI | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SQRTPI
270286
SUBTOTAL | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUBTOTAL
271287
SUM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUM
272288
SUMIF | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIF
273-
SUMIFS | **Not yet Implemented**
289+
SUMIFS | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIFS
274290
SUMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMPRODUCT
275291
SUMSQ | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMSQ
276292
SUMX2MY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2MY2
@@ -336,6 +352,7 @@ MIN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MIN
336352
MINA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINA
337353
MINIF | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINIF
338354
MODE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE
355+
MODE.SNGL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE
339356
NEGBINOMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NEGBINOMDIST
340357
NORMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMDIST
341358
NORMINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMINV
@@ -355,6 +372,8 @@ SLOPE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SLOPE
355372
SMALL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SMALL
356373
STANDARDIZE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE
357374
STDEV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV
375+
STDEV.S | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV
376+
STDEV.P | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP
358377
STDEVA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA
359378
STDEVP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP
360379
STDEVPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA
@@ -365,6 +384,8 @@ TREND | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TREND
365384
TRIMMEAN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TRIMMEAN
366385
TTEST | **Not yet Implemented**
367386
VAR | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc
387+
VAR.P | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP
388+
VAR.S | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc
368389
VARA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARA
369390
VARP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP
370391
VARPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARPA
@@ -380,9 +401,10 @@ BAHTTEXT | **Not yet Implemented**
380401
CHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER
381402
CLEAN | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMNONPRINTABLE
382403
CODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE
404+
CONCAT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE
383405
CONCATENATE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE
384406
DOLLAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::DOLLAR
385-
EXACT | **Not yet Implemented**
407+
EXACT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::EXACT
386408
FIND | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE
387409
FINDB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE
388410
FIXED | \PhpOffice\PhpSpreadsheet\Calculation\TextData::FIXEDFORMAT
@@ -394,6 +416,7 @@ LENB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENG
394416
LOWER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LOWERCASE
395417
MID | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID
396418
MIDB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID
419+
NUMBERVALUE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::NUMBERVALUE
397420
PHONETIC | **Not yet Implemented**
398421
PROPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::PROPERCASE
399422
REPLACE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::REPLACE
@@ -406,6 +429,9 @@ SEARCHB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSE
406429
SUBSTITUTE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SUBSTITUTE
407430
T | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RETURNSTRING
408431
TEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTFORMAT
432+
TEXTJOIN | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTJOIN
409433
TRIM | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMSPACES
434+
UNICHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER
435+
UNICODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE
410436
UPPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::UPPERCASE
411-
VALUE | **Not yet Implemented**
437+
VALUE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::VALUE

0 commit comments

Comments
 (0)