diff --git a/src/xlsx/constants.ts b/src/xlsx/constants.ts index 5ac2d70540..9230146a3f 100644 --- a/src/xlsx/constants.ts +++ b/src/xlsx/constants.ts @@ -95,6 +95,7 @@ export const FORCE_DEFAULT_ARGS_FUNCTIONS: Record ROUND: [{ type: "NUMBER", value: 0 }], ROUNDUP: [{ type: "NUMBER", value: 0 }], ROUNDDOWN: [{ type: "NUMBER", value: 0 }], + IFERROR: [{ type: "NUMBER", value: 0 }], }; /** diff --git a/tests/xlsx/xlsx_export.test.ts b/tests/xlsx/xlsx_export.test.ts index e8584fded2..2527479065 100644 --- a/tests/xlsx/xlsx_export.test.ts +++ b/tests/xlsx/xlsx_export.test.ts @@ -441,6 +441,10 @@ describe("Test XLSX export", () => { test("formula with dependencies", () => { expect(adaptFormulaToExcel("=SUM(A1, A2)")).toEqual("SUM(A1,A2)"); }); + + test("formula with default arguments required by Excel", () => { + expect(adaptFormulaToExcel("=IFERROR(1/0)")).toEqual("IFERROR(1/0,0)"); + }); }); describe("Generic sheets (style, hidden, size, cf)", () => { test("Simple model data with default style", async () => {