Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(formula): fixed the issue where null values ​​in IF formulas would return #N/A errors (#5861)

wpxp1234569026ac7cb263
diff --git a/packages/engine-formula/src/functions/compatibility/betadist/index.ts b/packages/engine-formula/src/functions/compatibility/betadist/index.ts
index 7b19dfe45f..68c0a36d83 100644
--- a/packages/engine-formula/src/functions/compatibility/betadist/index.ts
+++ b/packages/engine-formula/src/functions/compatibility/betadist/index.ts
@@ -75,7 +75,7 @@ export class Betadist extends BaseFunction {
const AObject = AArray.get(rowIndex, columnIndex) as BaseValueObject;
const BObject = BArray.get(rowIndex, columnIndex) as BaseValueObject;
- return this._handleSignleObject(xObject, alphaObject, betaObject, AObject, BObject);
+ return this._handleSingleObject(xObject, alphaObject, betaObject, AObject, BObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class Betadist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
alphaObject: BaseValueObject,
betaObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/compatibility/hypgeomdist/index.ts b/packages/engine-formula/src/functions/compatibility/hypgeomdist/index.ts
index 7f5e39791e..950b044cfa 100644
--- a/packages/engine-formula/src/functions/compatibility/hypgeomdist/index.ts
+++ b/packages/engine-formula/src/functions/compatibility/hypgeomdist/index.ts
@@ -75,7 +75,7 @@ export class Hypgeomdist extends BaseFunction {
return numberPopObject;
}
- return this._handleSignleObject(sampleSObject, numberSampleObject, populationSObject, numberPopObject);
+ return this._handleSingleObject(sampleSObject, numberSampleObject, populationSObject, numberPopObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class Hypgeomdist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
sampleSObject: BaseValueObject,
numberSampleObject: BaseValueObject,
populationSObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/compatibility/lognormdist/index.ts b/packages/engine-formula/src/functions/compatibility/lognormdist/index.ts
index 4df2868119..b530df356f 100644
--- a/packages/engine-formula/src/functions/compatibility/lognormdist/index.ts
+++ b/packages/engine-formula/src/functions/compatibility/lognormdist/index.ts
@@ -66,7 +66,7 @@ export class Lognormdist extends BaseFunction {
return standardDevObject;
}
- return this._handleSignleObject(xObject, meanObject, standardDevObject);
+ return this._handleSingleObject(xObject, meanObject, standardDevObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class Lognormdist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
meanObject: BaseValueObject,
standardDevObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/compatibility/negbinomdist/index.ts b/packages/engine-formula/src/functions/compatibility/negbinomdist/index.ts
index 963ec570a5..8724c303aa 100644
--- a/packages/engine-formula/src/functions/compatibility/negbinomdist/index.ts
+++ b/packages/engine-formula/src/functions/compatibility/negbinomdist/index.ts
@@ -66,7 +66,7 @@ export class Negbinomdist extends BaseFunction {
return probabilitySObject;
}
- return this._handleSignleObject(numberFObject, numberSObject, probabilitySObject);
+ return this._handleSingleObject(numberFObject, numberSObject, probabilitySObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class Negbinomdist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
numberFObject: BaseValueObject,
numberSObject: BaseValueObject,
probabilitySObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/compatibility/normsdist/index.ts b/packages/engine-formula/src/functions/compatibility/normsdist/index.ts
index 366fe6e8af..edf8a2dfc8 100644
--- a/packages/engine-formula/src/functions/compatibility/normsdist/index.ts
+++ b/packages/engine-formula/src/functions/compatibility/normsdist/index.ts
@@ -14,12 +14,12 @@
* limitations under the License.
*/
+import type { ArrayValueObject } from '../../../engine/value-object/array-value-object';
+import type { BaseValueObject, ErrorValueObject } from '../../../engine/value-object/base-value-object';
import { normalCDF } from '../../../basics/statistical';
import { checkVariantsErrorIsStringToNumber } from '../../../engine/utils/check-variant-error';
import { NumberValueObject } from '../../../engine/value-object/primitive-object';
import { BaseFunction } from '../../base-function';
-import type { ArrayValueObject } from '../../../engine/value-object/array-value-object';
-import type { BaseValueObject, ErrorValueObject } from '../../../engine/value-object/base-value-object';
export class Normsdist extends BaseFunction {
override minParams = 1;
@@ -28,7 +28,7 @@ export class Normsdist extends BaseFunction {
override calculate(z: BaseValueObject): BaseValueObject {
if (z.isArray()) {
- const resultArray = (z as ArrayValueObject).mapValue((zObject) => this._handleSignleObject(zObject));
+ const resultArray = (z as ArrayValueObject).mapValue((zObject) => this._handleSingleObject(zObject));
if ((z as ArrayValueObject).getRowCount() === 1 && (z as ArrayValueObject).getColumnCount() === 1) {
return (resultArray as ArrayValueObject).get(0, 0) as BaseValueObject;
@@ -37,10 +37,10 @@ export class Normsdist extends BaseFunction {
return resultArray;
}
- return this._handleSignleObject(z);
+ return this._handleSingleObject(z);
}
- private _handleSignleObject(zObject: BaseValueObject): BaseValueObject {
+ private _handleSingleObject(zObject: BaseValueObject): BaseValueObject {
const { isError, errorObject, variants } = checkVariantsErrorIsStringToNumber(zObject);
if (isError) {
diff --git a/packages/engine-formula/src/functions/compatibility/tdist/index.ts b/packages/engine-formula/src/functions/compatibility/tdist/index.ts
index 7583e1a0d5..7d1bc41667 100644
--- a/packages/engine-formula/src/functions/compatibility/tdist/index.ts
+++ b/packages/engine-formula/src/functions/compatibility/tdist/index.ts
@@ -66,7 +66,7 @@ export class Tdist extends BaseFunction {
return tailsObject;
}
- return this._handleSignleObject(xObject, degFreedomObject, tailsObject);
+ return this._handleSingleObject(xObject, degFreedomObject, tailsObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class Tdist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedomObject: BaseValueObject,
tailsObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/logical/if/__tests__/index.spec.ts b/packages/engine-formula/src/functions/logical/if/__tests__/index.spec.ts
index c776afa6f4..1ba54a6348 100644
--- a/packages/engine-formula/src/functions/logical/if/__tests__/index.spec.ts
+++ b/packages/engine-formula/src/functions/logical/if/__tests__/index.spec.ts
@@ -16,7 +16,7 @@
import { describe, expect, it } from 'vitest';
import { ArrayValueObject, transformToValueObject } from '../../../../engine/value-object/array-value-object';
-import { BooleanValueObject, NumberValueObject, StringValueObject } from '../../../../engine/value-object/primitive-object';
+import { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from '../../../../engine/value-object/primitive-object';
import { getObjectValue } from '../../../__tests__/create-function-test-bed';
import { FUNCTION_NAMES_LOGICAL } from '../../function-names';
import { If } from '../index';
@@ -500,5 +500,25 @@ describe('Test if function', () => {
['no1', 'no2', 'no3', '#N/A'],
]);
});
+
+ it('More test', () => {
+ const logicTest = NullValueObject.create();
+ const valueIfTrue = NumberValueObject.create(1);
+ const valueIfFalse = NumberValueObject.create(2);
+ const result = testFunction.calculate(logicTest, valueIfTrue, valueIfFalse);
+ expect(getObjectValue(result)).toBe(2);
+
+ const logicTest2 = BooleanValueObject.create(true);
+ const valueIfTrue2 = NullValueObject.create();
+ const valueIfFalse2 = NumberValueObject.create(2);
+ const result2 = testFunction.calculate(logicTest2, valueIfTrue2, valueIfFalse2);
+ expect(getObjectValue(result2)).toBe(0);
+
+ const logicTest3 = BooleanValueObject.create(false);
+ const valueIfTrue3 = NumberValueObject.create(1);
+ const valueIfFalse3 = NullValueObject.create();
+ const result3 = testFunction.calculate(logicTest3, valueIfTrue3, valueIfFalse3);
+ expect(getObjectValue(result3)).toBe(0);
+ });
});
});
diff --git a/packages/engine-formula/src/functions/logical/if/index.ts b/packages/engine-formula/src/functions/logical/if/index.ts
index c99746de48..8c4c079906 100644
--- a/packages/engine-formula/src/functions/logical/if/index.ts
+++ b/packages/engine-formula/src/functions/logical/if/index.ts
@@ -19,7 +19,7 @@ import type { BaseValueObject } from '../../../engine/value-object/base-value-ob
import { ErrorType } from '../../../basics/error-type';
import { expandArrayValueObject } from '../../../engine/utils/array-object';
import { ErrorValueObject } from '../../../engine/value-object/base-value-object';
-import { BooleanValueObject, NullValueObject } from '../../../engine/value-object/primitive-object';
+import { BooleanValueObject, NumberValueObject } from '../../../engine/value-object/primitive-object';
import { BaseFunction } from '../../base-function';
export class If extends BaseFunction {
@@ -28,15 +28,19 @@ export class If extends BaseFunction {
override maxParams = 3;
override calculate(logicalTest: BaseValueObject, valueIfTrue: BaseValueObject, valueIfFalse: BaseValueObject = BooleanValueObject.create(false)) {
- // get single value object
- const _logicalTest = this._getSingleValueObject(logicalTest);
+ let _logicalTest = logicalTest;
- if (_logicalTest.isError()) {
- return _logicalTest;
+ if (logicalTest.isArray()) {
+ const rowCount = (logicalTest as ArrayValueObject).getRowCount();
+ const columnCount = (logicalTest as ArrayValueObject).getColumnCount();
+
+ if (rowCount === 1 && columnCount === 1) {
+ _logicalTest = (logicalTest as ArrayValueObject).get(0, 0) as BaseValueObject;
+ }
}
if (!_logicalTest.isArray()) {
- return _logicalTest.getValue() ? valueIfTrue : valueIfFalse;
+ return this._handleSingleObject(_logicalTest, valueIfTrue, valueIfFalse);
}
// get max row length
@@ -53,49 +57,32 @@ export class If extends BaseFunction {
valueIfFalse.isArray() ? (valueIfFalse as ArrayValueObject).getColumnCount() : 1
);
- const logicalTestArray = expandArrayValueObject(maxRowLength, maxColumnLength, _logicalTest);
+ const logicalTestArray = expandArrayValueObject(maxRowLength, maxColumnLength, _logicalTest, ErrorValueObject.create(ErrorType.NA));
const valueIfTrueArray = expandArrayValueObject(maxRowLength, maxColumnLength, valueIfTrue, ErrorValueObject.create(ErrorType.NA));
const valueIfFalseArray = expandArrayValueObject(maxRowLength, maxColumnLength, valueIfFalse, ErrorValueObject.create(ErrorType.NA));
- return logicalTestArray.map((logicalTestValue, rowIndex, columnIndex) => {
- if (logicalTestValue.isNull()) {
- return ErrorValueObject.create(ErrorType.NA);
- } else {
- const valueIfTrueValue = valueIfTrueArray.get(rowIndex, columnIndex) || NullValueObject.create();
- const valueIfFalseValue = valueIfFalseArray.get(rowIndex, columnIndex) || NullValueObject.create();
+ return logicalTestArray.mapValue((logicalTestValue, rowIndex, columnIndex) => {
+ const valueIfTrueValue = valueIfTrueArray.get(rowIndex, columnIndex) as BaseValueObject;
+ const valueIfFalseValue = valueIfFalseArray.get(rowIndex, columnIndex) as BaseValueObject;
- return this._calculateSingleCell(logicalTestValue, valueIfTrueValue, valueIfFalseValue);
- }
+ return this._handleSingleObject(logicalTestValue, valueIfTrueValue, valueIfFalseValue);
});
}
- private _getSingleValueObject(valueObject: BaseValueObject) {
- if (valueObject.isArray() && (valueObject as ArrayValueObject).getRowCount() === 1 && (valueObject as ArrayValueObject).getColumnCount() === 1) {
- return (valueObject as ArrayValueObject).getFirstCell();
- }
- return valueObject;
- }
-
- private _calculateSingleCell(logicalTest: BaseValueObject, valueIfTrue: BaseValueObject, valueIfFalse: BaseValueObject) {
- if (logicalTest.isNull()) {
- return ErrorValueObject.create(ErrorType.NA);
+ private _handleSingleObject(logicalTest: BaseValueObject, valueIfTrue: BaseValueObject, valueIfFalse: BaseValueObject) {
+ if (logicalTest.isError()) {
+ return logicalTest;
}
const logicalTestValue = logicalTest.getValue();
// true or non-zero
- if (logicalTestValue) {
- if (valueIfTrue.isNull()) {
- return ErrorValueObject.create(ErrorType.NA);
- }
-
- return valueIfTrue;
- }
-
- if (valueIfFalse.isNull()) {
- return ErrorValueObject.create(ErrorType.NA);
- }
-
- return valueIfFalse;
+ return logicalTestValue
+ ? valueIfTrue.isNull()
+ ? NumberValueObject.create(0)
+ : valueIfTrue
+ : valueIfFalse.isNull()
+ ? NumberValueObject.create(0)
+ : valueIfFalse;
}
}
diff --git a/packages/engine-formula/src/functions/statistical/beta-dist/index.ts b/packages/engine-formula/src/functions/statistical/beta-dist/index.ts
index 5a055a1ed7..7921acec0a 100644
--- a/packages/engine-formula/src/functions/statistical/beta-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/beta-dist/index.ts
@@ -80,7 +80,7 @@ export class BetaDist extends BaseFunction {
const AObject = AArray.get(rowIndex, columnIndex) as BaseValueObject;
const BObject = BArray.get(rowIndex, columnIndex) as BaseValueObject;
- return this._handleSignleObject(xObject, alphaObject, betaObject, cumulativeObject, AObject, BObject);
+ return this._handleSingleObject(xObject, alphaObject, betaObject, cumulativeObject, AObject, BObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -90,7 +90,7 @@ export class BetaDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
alphaObject: BaseValueObject,
betaObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/beta-inv/index.ts b/packages/engine-formula/src/functions/statistical/beta-inv/index.ts
index 29ec426946..be67932c8d 100644
--- a/packages/engine-formula/src/functions/statistical/beta-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/beta-inv/index.ts
@@ -75,7 +75,7 @@ export class BetaInv extends BaseFunction {
const AObject = AArray.get(rowIndex, columnIndex) as BaseValueObject;
const BObject = BArray.get(rowIndex, columnIndex) as BaseValueObject;
- return this._handleSignleObject(probabilityObject, alphaObject, betaObject, AObject, BObject);
+ return this._handleSingleObject(probabilityObject, alphaObject, betaObject, AObject, BObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class BetaInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
alphaObject: BaseValueObject,
betaObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/binom-dist-range/index.ts b/packages/engine-formula/src/functions/statistical/binom-dist-range/index.ts
index 4d6137ba3a..ab20c1a48e 100644
--- a/packages/engine-formula/src/functions/statistical/binom-dist-range/index.ts
+++ b/packages/engine-formula/src/functions/statistical/binom-dist-range/index.ts
@@ -81,7 +81,7 @@ export class BinomDistRange extends BaseFunction {
return numberS2Object;
}
- return this._handleSignleObject(trialsObject, probabilitySObject, numberSObject, numberS2Object);
+ return this._handleSingleObject(trialsObject, probabilitySObject, numberSObject, numberS2Object);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -91,7 +91,7 @@ export class BinomDistRange extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
trialsObject: BaseValueObject,
probabilitySObject: BaseValueObject,
numberSObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/binom-dist/index.ts b/packages/engine-formula/src/functions/statistical/binom-dist/index.ts
index 97f2c4c124..60752d3e47 100644
--- a/packages/engine-formula/src/functions/statistical/binom-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/binom-dist/index.ts
@@ -75,7 +75,7 @@ export class BinomDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(numberSObject, trialsObject, probabilitySObject, cumulativeObject);
+ return this._handleSingleObject(numberSObject, trialsObject, probabilitySObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class BinomDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
numberSObject: BaseValueObject,
trialsObject: BaseValueObject,
probabilitySObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/binom-inv/index.ts b/packages/engine-formula/src/functions/statistical/binom-inv/index.ts
index 8ffbcdce2a..a4a655dfb6 100644
--- a/packages/engine-formula/src/functions/statistical/binom-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/binom-inv/index.ts
@@ -66,7 +66,7 @@ export class BinomInv extends BaseFunction {
return alphaObject;
}
- return this._handleSignleObject(trialsObject, probabilitySObject, alphaObject);
+ return this._handleSingleObject(trialsObject, probabilitySObject, alphaObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class BinomInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
trialsObject: BaseValueObject,
probabilitySObject: BaseValueObject,
alphaObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/chisq-dist-rt/index.ts b/packages/engine-formula/src/functions/statistical/chisq-dist-rt/index.ts
index 1a37006627..5fcca0f573 100644
--- a/packages/engine-formula/src/functions/statistical/chisq-dist-rt/index.ts
+++ b/packages/engine-formula/src/functions/statistical/chisq-dist-rt/index.ts
@@ -57,7 +57,7 @@ export class ChisqDistRt extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(xObject, degFreedomObject);
+ return this._handleSingleObject(xObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class ChisqDistRt extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/chisq-dist/index.ts b/packages/engine-formula/src/functions/statistical/chisq-dist/index.ts
index fe3255025b..c3767e8d65 100644
--- a/packages/engine-formula/src/functions/statistical/chisq-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/chisq-dist/index.ts
@@ -66,7 +66,7 @@ export class ChisqDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, degFreedomObject, cumulativeObject);
+ return this._handleSingleObject(xObject, degFreedomObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class ChisqDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedomObject: BaseValueObject,
cumulativeObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/chisq-inv-rt/index.ts b/packages/engine-formula/src/functions/statistical/chisq-inv-rt/index.ts
index c21e183c47..58076d5c50 100644
--- a/packages/engine-formula/src/functions/statistical/chisq-inv-rt/index.ts
+++ b/packages/engine-formula/src/functions/statistical/chisq-inv-rt/index.ts
@@ -57,7 +57,7 @@ export class ChisqInvRt extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(probabilityObject, degFreedomObject);
+ return this._handleSingleObject(probabilityObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class ChisqInvRt extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/chisq-inv/index.ts b/packages/engine-formula/src/functions/statistical/chisq-inv/index.ts
index 3916b7cedb..2e8ac0cc87 100644
--- a/packages/engine-formula/src/functions/statistical/chisq-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/chisq-inv/index.ts
@@ -57,7 +57,7 @@ export class ChisqInv extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(probabilityObject, degFreedomObject);
+ return this._handleSingleObject(probabilityObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class ChisqInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/expon-dist/index.ts b/packages/engine-formula/src/functions/statistical/expon-dist/index.ts
index 98c8e45eaf..b2776b69cd 100644
--- a/packages/engine-formula/src/functions/statistical/expon-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/expon-dist/index.ts
@@ -66,7 +66,7 @@ export class ExponDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, lambdaObject, cumulativeObject);
+ return this._handleSingleObject(xObject, lambdaObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class ExponDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
lambdaObject: BaseValueObject,
cumulativeObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/f-dist-rt/index.ts b/packages/engine-formula/src/functions/statistical/f-dist-rt/index.ts
index c083f84a2c..8ec98ae155 100644
--- a/packages/engine-formula/src/functions/statistical/f-dist-rt/index.ts
+++ b/packages/engine-formula/src/functions/statistical/f-dist-rt/index.ts
@@ -66,7 +66,7 @@ export class FDistRt extends BaseFunction {
return degFreedom2Object;
}
- return this._handleSignleObject(xObject, degFreedom1Object, degFreedom2Object);
+ return this._handleSingleObject(xObject, degFreedom1Object, degFreedom2Object);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class FDistRt extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedom1Object: BaseValueObject,
degFreedom2Object: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/f-dist/index.ts b/packages/engine-formula/src/functions/statistical/f-dist/index.ts
index 518b0eb7d3..6df6f51b11 100644
--- a/packages/engine-formula/src/functions/statistical/f-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/f-dist/index.ts
@@ -75,7 +75,7 @@ export class FDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, degFreedom1Object, degFreedom2Object, cumulativeObject);
+ return this._handleSingleObject(xObject, degFreedom1Object, degFreedom2Object, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class FDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedom1Object: BaseValueObject,
degFreedom2Object: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/f-inv-rt/index.ts b/packages/engine-formula/src/functions/statistical/f-inv-rt/index.ts
index 5af6007ea4..eb9082d416 100644
--- a/packages/engine-formula/src/functions/statistical/f-inv-rt/index.ts
+++ b/packages/engine-formula/src/functions/statistical/f-inv-rt/index.ts
@@ -66,7 +66,7 @@ export class FInvRt extends BaseFunction {
return degFreedom2Object;
}
- return this._handleSignleObject(probabilityObject, degFreedom1Object, degFreedom2Object);
+ return this._handleSingleObject(probabilityObject, degFreedom1Object, degFreedom2Object);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class FInvRt extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
degFreedom1Object: BaseValueObject,
degFreedom2Object: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/f-inv/index.ts b/packages/engine-formula/src/functions/statistical/f-inv/index.ts
index 35b0208ca7..cd5ac0542a 100644
--- a/packages/engine-formula/src/functions/statistical/f-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/f-inv/index.ts
@@ -66,7 +66,7 @@ export class FInv extends BaseFunction {
return degFreedom2Object;
}
- return this._handleSignleObject(probabilityObject, degFreedom1Object, degFreedom2Object);
+ return this._handleSingleObject(probabilityObject, degFreedom1Object, degFreedom2Object);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class FInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
degFreedom1Object: BaseValueObject,
degFreedom2Object: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/forecast/index.ts b/packages/engine-formula/src/functions/statistical/forecast/index.ts
index 8ee641bd5c..9ba24a85d2 100644
--- a/packages/engine-formula/src/functions/statistical/forecast/index.ts
+++ b/packages/engine-formula/src/functions/statistical/forecast/index.ts
@@ -48,14 +48,14 @@ export class Forecast extends BaseFunction {
if (x.isArray()) {
return (x as ArrayValueObject).mapValue(
- (xObject) => this._handleSignleObject(xObject, _knownYs, _knownXs, knownYsRowCount, knownYsColumnCount, knownXsRowCount, knownXsColumnCount)
+ (xObject) => this._handleSingleObject(xObject, _knownYs, _knownXs, knownYsRowCount, knownYsColumnCount, knownXsRowCount, knownXsColumnCount)
);
}
- return this._handleSignleObject(x, _knownYs, _knownXs, knownYsRowCount, knownYsColumnCount, knownXsRowCount, knownXsColumnCount);
+ return this._handleSingleObject(x, _knownYs, _knownXs, knownYsRowCount, knownYsColumnCount, knownXsRowCount, knownXsColumnCount);
}
- private _handleSignleObject(
+ private _handleSingleObject(
x: BaseValueObject,
knownYs: BaseValueObject,
knownXs: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/gamma-dist/index.ts b/packages/engine-formula/src/functions/statistical/gamma-dist/index.ts
index 16b74cc330..97b2fbf978 100644
--- a/packages/engine-formula/src/functions/statistical/gamma-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/gamma-dist/index.ts
@@ -75,7 +75,7 @@ export class GammaDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, alphaObject, betaObject, cumulativeObject);
+ return this._handleSingleObject(xObject, alphaObject, betaObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class GammaDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
alphaObject: BaseValueObject,
betaObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/gamma-inv/index.ts b/packages/engine-formula/src/functions/statistical/gamma-inv/index.ts
index ac0a2eca4a..8ef9c2ff37 100644
--- a/packages/engine-formula/src/functions/statistical/gamma-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/gamma-inv/index.ts
@@ -66,7 +66,7 @@ export class GammaInv extends BaseFunction {
return betaObject;
}
- return this._handleSignleObject(probabilityObject, alphaObject, betaObject);
+ return this._handleSingleObject(probabilityObject, alphaObject, betaObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class GammaInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
alphaObject: BaseValueObject,
betaObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/hypgeom-dist/index.ts b/packages/engine-formula/src/functions/statistical/hypgeom-dist/index.ts
index 20e1d8a525..4f6192b422 100644
--- a/packages/engine-formula/src/functions/statistical/hypgeom-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/hypgeom-dist/index.ts
@@ -84,7 +84,7 @@ export class HypgeomDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(sampleSObject, numberSampleObject, populationSObject, numberPopObject, cumulativeObject);
+ return this._handleSingleObject(sampleSObject, numberSampleObject, populationSObject, numberPopObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -94,7 +94,7 @@ export class HypgeomDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
sampleSObject: BaseValueObject,
numberSampleObject: BaseValueObject,
populationSObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/lognorm-dist/index.ts b/packages/engine-formula/src/functions/statistical/lognorm-dist/index.ts
index ece5579678..25b0403d6f 100644
--- a/packages/engine-formula/src/functions/statistical/lognorm-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/lognorm-dist/index.ts
@@ -75,7 +75,7 @@ export class LognormDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, meanObject, standardDevObject, cumulativeObject);
+ return this._handleSingleObject(xObject, meanObject, standardDevObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class LognormDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
meanObject: BaseValueObject,
standardDevObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/lognorm-inv/index.ts b/packages/engine-formula/src/functions/statistical/lognorm-inv/index.ts
index 467b1cbd0c..76efbb727d 100644
--- a/packages/engine-formula/src/functions/statistical/lognorm-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/lognorm-inv/index.ts
@@ -66,7 +66,7 @@ export class LognormInv extends BaseFunction {
return standardDevObject;
}
- return this._handleSignleObject(probabilityObject, meanObject, standardDevObject);
+ return this._handleSingleObject(probabilityObject, meanObject, standardDevObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class LognormInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
meanObject: BaseValueObject,
standardDevObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/negbinom-dist/index.ts b/packages/engine-formula/src/functions/statistical/negbinom-dist/index.ts
index 5b372009fd..a4171af268 100644
--- a/packages/engine-formula/src/functions/statistical/negbinom-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/negbinom-dist/index.ts
@@ -75,7 +75,7 @@ export class NegbinomDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(numberFObject, numberSObject, probabilitySObject, cumulativeObject);
+ return this._handleSingleObject(numberFObject, numberSObject, probabilitySObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class NegbinomDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
numberFObject: BaseValueObject,
numberSObject: BaseValueObject,
probabilitySObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/norm-dist/index.ts b/packages/engine-formula/src/functions/statistical/norm-dist/index.ts
index 83f8ded46b..7ec2ae5dc1 100644
--- a/packages/engine-formula/src/functions/statistical/norm-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/norm-dist/index.ts
@@ -75,7 +75,7 @@ export class NormDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, meanObject, standardDevObject, cumulativeObject);
+ return this._handleSingleObject(xObject, meanObject, standardDevObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -85,7 +85,7 @@ export class NormDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
meanObject: BaseValueObject,
standardDevObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/norm-inv/index.ts b/packages/engine-formula/src/functions/statistical/norm-inv/index.ts
index 18df9895aa..c92ce5fd7f 100644
--- a/packages/engine-formula/src/functions/statistical/norm-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/norm-inv/index.ts
@@ -66,7 +66,7 @@ export class NormInv extends BaseFunction {
return standardDevObject;
}
- return this._handleSignleObject(probabilityObject, meanObject, standardDevObject);
+ return this._handleSingleObject(probabilityObject, meanObject, standardDevObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class NormInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
meanObject: BaseValueObject,
standardDevObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/norm-s-dist/index.ts b/packages/engine-formula/src/functions/statistical/norm-s-dist/index.ts
index 5202d462ed..7b55efebd2 100644
--- a/packages/engine-formula/src/functions/statistical/norm-s-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/norm-s-dist/index.ts
@@ -57,7 +57,7 @@ export class NormSDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(zObject, cumulativeObject);
+ return this._handleSingleObject(zObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class NormSDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
zObject: BaseValueObject,
cumulativeObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/norm-s-inv/index.ts b/packages/engine-formula/src/functions/statistical/norm-s-inv/index.ts
index 82bdb92849..7de5785170 100644
--- a/packages/engine-formula/src/functions/statistical/norm-s-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/norm-s-inv/index.ts
@@ -30,7 +30,7 @@ export class NormSInv extends BaseFunction {
override calculate(probability: BaseValueObject): BaseValueObject {
if (probability.isArray()) {
- const resultArray = (probability as ArrayValueObject).mapValue((probabilityObject) => this._handleSignleObject(probabilityObject));
+ const resultArray = (probability as ArrayValueObject).mapValue((probabilityObject) => this._handleSingleObject(probabilityObject));
if ((probability as ArrayValueObject).getRowCount() === 1 && (probability as ArrayValueObject).getColumnCount() === 1) {
return (resultArray as ArrayValueObject).get(0, 0) as BaseValueObject;
@@ -39,10 +39,10 @@ export class NormSInv extends BaseFunction {
return resultArray;
}
- return this._handleSignleObject(probability);
+ return this._handleSingleObject(probability);
}
- private _handleSignleObject(probabilityObject: BaseValueObject): BaseValueObject {
+ private _handleSingleObject(probabilityObject: BaseValueObject): BaseValueObject {
const { isError, errorObject, variants } = checkVariantsErrorIsStringToNumber(probabilityObject);
if (isError) {
diff --git a/packages/engine-formula/src/functions/statistical/poisson-dist/index.ts b/packages/engine-formula/src/functions/statistical/poisson-dist/index.ts
index a8a8c2563c..3f03a53bd3 100644
--- a/packages/engine-formula/src/functions/statistical/poisson-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/poisson-dist/index.ts
@@ -66,7 +66,7 @@ export class PoissonDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, meanObject, cumulativeObject);
+ return this._handleSingleObject(xObject, meanObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class PoissonDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
meanObject: BaseValueObject,
cumulativeObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/prob/index.ts b/packages/engine-formula/src/functions/statistical/prob/index.ts
index 4eff0fa19d..2b1a1fe08d 100644
--- a/packages/engine-formula/src/functions/statistical/prob/index.ts
+++ b/packages/engine-formula/src/functions/statistical/prob/index.ts
@@ -74,7 +74,7 @@ export class Prob extends BaseFunction {
return errorObject as ErrorValueObject;
}
- return this._handleSignleObject(xRangeValues as number[], probRangeValues as number[], lowerLimitObject, upperLimitObject);
+ return this._handleSingleObject(xRangeValues as number[], probRangeValues as number[], lowerLimitObject, upperLimitObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -84,7 +84,7 @@ export class Prob extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xRangeValues: number[],
probRangeValues: number[],
lowerLimit: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/standardize/index.ts b/packages/engine-formula/src/functions/statistical/standardize/index.ts
index d4c6ae31ce..6558a81e4a 100644
--- a/packages/engine-formula/src/functions/statistical/standardize/index.ts
+++ b/packages/engine-formula/src/functions/statistical/standardize/index.ts
@@ -65,7 +65,7 @@ export class Standardize extends BaseFunction {
return standardDevObject;
}
- return this._handleSignleObject(xObject, meanObject, standardDevObject);
+ return this._handleSingleObject(xObject, meanObject, standardDevObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -75,7 +75,7 @@ export class Standardize extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
meanObject: BaseValueObject,
standardDevObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/t-dist-2t/index.ts b/packages/engine-formula/src/functions/statistical/t-dist-2t/index.ts
index dc5d3da75c..7d09c102b2 100644
--- a/packages/engine-formula/src/functions/statistical/t-dist-2t/index.ts
+++ b/packages/engine-formula/src/functions/statistical/t-dist-2t/index.ts
@@ -57,7 +57,7 @@ export class TDist2t extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(xObject, degFreedomObject);
+ return this._handleSingleObject(xObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class TDist2t extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/t-dist-rt/index.ts b/packages/engine-formula/src/functions/statistical/t-dist-rt/index.ts
index 963a0eb6a4..613eae6c11 100644
--- a/packages/engine-formula/src/functions/statistical/t-dist-rt/index.ts
+++ b/packages/engine-formula/src/functions/statistical/t-dist-rt/index.ts
@@ -57,7 +57,7 @@ export class TDistRt extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(xObject, degFreedomObject);
+ return this._handleSingleObject(xObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class TDistRt extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/t-dist/index.ts b/packages/engine-formula/src/functions/statistical/t-dist/index.ts
index b5cf3c16cf..8070627cf0 100644
--- a/packages/engine-formula/src/functions/statistical/t-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/t-dist/index.ts
@@ -66,7 +66,7 @@ export class TDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, degFreedomObject, cumulativeObject);
+ return this._handleSingleObject(xObject, degFreedomObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -76,7 +76,7 @@ export class TDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
degFreedomObject: BaseValueObject,
cumulativeObject: BaseValueObject
diff --git a/packages/engine-formula/src/functions/statistical/t-inv-2t/index.ts b/packages/engine-formula/src/functions/statistical/t-inv-2t/index.ts
index c32d7d2ce0..fc9898ff9d 100644
--- a/packages/engine-formula/src/functions/statistical/t-inv-2t/index.ts
+++ b/packages/engine-formula/src/functions/statistical/t-inv-2t/index.ts
@@ -57,7 +57,7 @@ export class TInv2t extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(probabilityObject, degFreedomObject);
+ return this._handleSingleObject(probabilityObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class TInv2t extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/t-inv/index.ts b/packages/engine-formula/src/functions/statistical/t-inv/index.ts
index 0862d55333..6930944fbe 100644
--- a/packages/engine-formula/src/functions/statistical/t-inv/index.ts
+++ b/packages/engine-formula/src/functions/statistical/t-inv/index.ts
@@ -57,7 +57,7 @@ export class TInv extends BaseFunction {
return degFreedomObject;
}
- return this._handleSignleObject(probabilityObject, degFreedomObject);
+ return this._handleSingleObject(probabilityObject, degFreedomObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -67,7 +67,7 @@ export class TInv extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
probabilityObject: BaseValueObject,
degFreedomObject: BaseValueObject
): BaseValueObject {
diff --git a/packages/engine-formula/src/functions/statistical/t-test/index.ts b/packages/engine-formula/src/functions/statistical/t-test/index.ts
index ba0f6f6bd8..6d1f4e3eb0 100644
--- a/packages/engine-formula/src/functions/statistical/t-test/index.ts
+++ b/packages/engine-formula/src/functions/statistical/t-test/index.ts
@@ -97,7 +97,7 @@ export class TTest extends BaseFunction {
return array2Values as ErrorValueObject;
}
- return this._handleSignleObject(
+ return this._handleSingleObject(
(typeValue === 1 ? array1Values_sp : array1Values) as number[],
(typeValue === 1 ? array2Values_sp : array2Values) as number[],
tailsValue,
@@ -112,7 +112,7 @@ export class TTest extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
array1Values: number[],
array2Values: number[],
tails: number,
diff --git a/packages/engine-formula/src/functions/statistical/weibull-dist/index.ts b/packages/engine-formula/src/functions/statistical/weibull-dist/index.ts
index 69e79ce58a..39396336d2 100644
--- a/packages/engine-formula/src/functions/statistical/weibull-dist/index.ts
+++ b/packages/engine-formula/src/functions/statistical/weibull-dist/index.ts
@@ -74,7 +74,7 @@ export class WeibullDist extends BaseFunction {
return cumulativeObject;
}
- return this._handleSignleObject(xObject, alphaObject, betaObject, cumulativeObject);
+ return this._handleSingleObject(xObject, alphaObject, betaObject, cumulativeObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -84,7 +84,7 @@ export class WeibullDist extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
xObject: BaseValueObject,
alphaObject: BaseValueObject,
betaObject: BaseValueObject,
diff --git a/packages/engine-formula/src/functions/statistical/z-test/index.ts b/packages/engine-formula/src/functions/statistical/z-test/index.ts
index c9ad74538c..094177df34 100644
--- a/packages/engine-formula/src/functions/statistical/z-test/index.ts
+++ b/packages/engine-formula/src/functions/statistical/z-test/index.ts
@@ -69,7 +69,7 @@ export class ZTest extends BaseFunction {
return ErrorValueObject.create(ErrorType.DIV_BY_ZERO);
}
- return this._handleSignleObject(arrayValues as number[], xObject, sigmaObject);
+ return this._handleSingleObject(arrayValues as number[], xObject, sigmaObject);
});
if (maxRowLength === 1 && maxColumnLength === 1) {
@@ -79,7 +79,7 @@ export class ZTest extends BaseFunction {
return resultArray;
}
- private _handleSignleObject(
+ private _handleSingleObject(
arrayValues: number[],
x: BaseValueObject,
sigma: BaseValueObject | undefined
diff --git a/packages/sheets/src/controllers/__tests__/formula/array-inverted-index-cache.spec.ts b/packages/sheets/src/controllers/__tests__/formula/array-inverted-index-cache.spec.ts
index 13657a95c1..628d563a99 100644
--- a/packages/sheets/src/controllers/__tests__/formula/array-inverted-index-cache.spec.ts
+++ b/packages/sheets/src/controllers/__tests__/formula/array-inverted-index-cache.spec.ts
@@ -340,6 +340,15 @@ describe('Test inverted index cache', () => {
// now result should be 1
expect(getCellValue(30, 3)).toBe(1);
+
+ const result = calculate('=IF((H5:H9=0.03)+(H5:H9=0.01), 0.01, H5:H9)');
+ expect(result).toEqual([
+ [0],
+ [0],
+ [0],
+ [0],
+ [0],
+ ]);
});
it('Sumif formula test', () => {