diff --git a/calc.go b/calc.go index 2a71c0e842..9b8bdcee72 100644 --- a/calc.go +++ b/calc.go @@ -15099,8 +15099,9 @@ func (fn *formulaFuncs) IF(argsList *list.List) formulaArg { default: result = newStringFormulaArg(value.Value()) } + return result } - return result + return newBoolFormulaArg(false) } // Lookup and Reference Functions diff --git a/calc_test.go b/calc_test.go index c6349379f8..9387ec8c6f 100644 --- a/calc_test.go +++ b/calc_test.go @@ -2155,6 +2155,8 @@ func TestCalcCellValue(t *testing.T) { "IF(2>0,(1),4)": "1", "IF(2>0,(A1)*2.5,4)": "2.5", "IF(VALUE(B3)=1,0,1)": "1", + "IF(1=2,1)": "FALSE", + "IF(1=2,1,IF(1=2,1))*2": "0", // Excel Lookup and Reference Functions // ADDRESS "ADDRESS(1,1,1,TRUE)": "$A$1",