|
@@ -4,7 +4,7 @@
|
|
|
//
|
|
//
|
|
|
// Package excelize providing a set of functions that allow you to write to
|
|
// Package excelize providing a set of functions that allow you to write to
|
|
|
// and read from XLSX / XLSM / XLTM files. Supports reading and writing
|
|
// and read from XLSX / XLSM / XLTM files. Supports reading and writing
|
|
|
-// spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
|
|
|
|
|
|
|
+// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
|
|
|
// complex components by high compatibility, and provided streaming API for
|
|
// complex components by high compatibility, and provided streaming API for
|
|
|
// generating or reading data from a worksheet with huge amounts of data. This
|
|
// generating or reading data from a worksheet with huge amounts of data. This
|
|
|
// library needs Go version 1.10 or later.
|
|
// library needs Go version 1.10 or later.
|
|
@@ -323,6 +323,7 @@ var tokenPriority = map[string]int{
|
|
|
// MROUND
|
|
// MROUND
|
|
|
// MULTINOMIAL
|
|
// MULTINOMIAL
|
|
|
// MUNIT
|
|
// MUNIT
|
|
|
|
|
+// N
|
|
|
// NA
|
|
// NA
|
|
|
// NORM.DIST
|
|
// NORM.DIST
|
|
|
// NORMDIST
|
|
// NORMDIST
|
|
@@ -339,6 +340,7 @@ var tokenPriority = map[string]int{
|
|
|
// OCT2HEX
|
|
// OCT2HEX
|
|
|
// ODD
|
|
// ODD
|
|
|
// OR
|
|
// OR
|
|
|
|
|
+// PERCENTILE.INC
|
|
|
// PERCENTILE
|
|
// PERCENTILE
|
|
|
// PERMUT
|
|
// PERMUT
|
|
|
// PERMUTATIONA
|
|
// PERMUTATIONA
|
|
@@ -380,6 +382,7 @@ var tokenPriority = map[string]int{
|
|
|
// SUM
|
|
// SUM
|
|
|
// SUMIF
|
|
// SUMIF
|
|
|
// SUMSQ
|
|
// SUMSQ
|
|
|
|
|
+// T
|
|
|
// TAN
|
|
// TAN
|
|
|
// TANH
|
|
// TANH
|
|
|
// TODAY
|
|
// TODAY
|
|
@@ -4521,6 +4524,19 @@ func (fn *formulaFuncs) min(mina bool, argsList *list.List) formulaArg {
|
|
|
return newNumberFormulaArg(min)
|
|
return newNumberFormulaArg(min)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// PERCENTILEdotINC function returns the k'th percentile (i.e. the value below
|
|
|
|
|
+// which k% of the data values fall) for a supplied range of values and a
|
|
|
|
|
+// supplied k. The syntax of the function is:
|
|
|
|
|
+//
|
|
|
|
|
+// PERCENTILE.INC(array,k)
|
|
|
|
|
+//
|
|
|
|
|
+func (fn *formulaFuncs) PERCENTILEdotINC(argsList *list.List) formulaArg {
|
|
|
|
|
+ if argsList.Len() != 2 {
|
|
|
|
|
+ return newErrorFormulaArg(formulaErrorVALUE, "PERCENTILE.INC requires 2 arguments")
|
|
|
|
|
+ }
|
|
|
|
|
+ return fn.PERCENTILE(argsList)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// PERCENTILE function returns the k'th percentile (i.e. the value below which
|
|
// PERCENTILE function returns the k'th percentile (i.e. the value below which
|
|
|
// k% of the data values fall) for a supplied range of values and a supplied
|
|
// k% of the data values fall) for a supplied range of values and a supplied
|
|
|
// k. The syntax of the function is:
|
|
// k. The syntax of the function is:
|
|
@@ -4858,6 +4874,28 @@ func (fn *formulaFuncs) ISTEXT(argsList *list.List) formulaArg {
|
|
|
return newBoolFormulaArg(token.Type == ArgString)
|
|
return newBoolFormulaArg(token.Type == ArgString)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// N function converts data into a numeric value. The syntax of the function
|
|
|
|
|
+// is:
|
|
|
|
|
+//
|
|
|
|
|
+// N(value)
|
|
|
|
|
+//
|
|
|
|
|
+func (fn *formulaFuncs) N(argsList *list.List) formulaArg {
|
|
|
|
|
+ if argsList.Len() != 1 {
|
|
|
|
|
+ return newErrorFormulaArg(formulaErrorVALUE, "N requires 1 argument")
|
|
|
|
|
+ }
|
|
|
|
|
+ token, num := argsList.Front().Value.(formulaArg), 0.0
|
|
|
|
|
+ if token.Type == ArgError {
|
|
|
|
|
+ return token
|
|
|
|
|
+ }
|
|
|
|
|
+ if arg := token.ToNumber(); arg.Type == ArgNumber {
|
|
|
|
|
+ num = arg.Number
|
|
|
|
|
+ }
|
|
|
|
|
+ if token.Value() == "TRUE" {
|
|
|
|
|
+ num = 1
|
|
|
|
|
+ }
|
|
|
|
|
+ return newNumberFormulaArg(num)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// NA function returns the Excel #N/A error. This error message has the
|
|
// NA function returns the Excel #N/A error. This error message has the
|
|
|
// meaning 'value not available' and is produced when an Excel Formula is
|
|
// meaning 'value not available' and is produced when an Excel Formula is
|
|
|
// unable to find a value that it needs. The syntax of the function is:
|
|
// unable to find a value that it needs. The syntax of the function is:
|
|
@@ -4883,6 +4921,26 @@ func (fn *formulaFuncs) SHEET(argsList *list.List) formulaArg {
|
|
|
return newNumberFormulaArg(float64(fn.f.GetSheetIndex(fn.sheet) + 1))
|
|
return newNumberFormulaArg(float64(fn.f.GetSheetIndex(fn.sheet) + 1))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// T function tests if a supplied value is text and if so, returns the
|
|
|
|
|
+// supplied text; Otherwise, the function returns an empty text string. The
|
|
|
|
|
+// syntax of the function is:
|
|
|
|
|
+//
|
|
|
|
|
+// T(value)
|
|
|
|
|
+//
|
|
|
|
|
+func (fn *formulaFuncs) T(argsList *list.List) formulaArg {
|
|
|
|
|
+ if argsList.Len() != 1 {
|
|
|
|
|
+ return newErrorFormulaArg(formulaErrorVALUE, "T requires 1 argument")
|
|
|
|
|
+ }
|
|
|
|
|
+ token := argsList.Front().Value.(formulaArg)
|
|
|
|
|
+ if token.Type == ArgError {
|
|
|
|
|
+ return token
|
|
|
|
|
+ }
|
|
|
|
|
+ if token.Type == ArgNumber {
|
|
|
|
|
+ return newStringFormulaArg("")
|
|
|
|
|
+ }
|
|
|
|
|
+ return newStringFormulaArg(token.Value())
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// Logical Functions
|
|
// Logical Functions
|
|
|
|
|
|
|
|
// AND function tests a number of supplied conditions and returns TRUE or
|
|
// AND function tests a number of supplied conditions and returns TRUE or
|