From 7f570c74f8623aec6e8f89ff3701f28c3a256ffe Mon Sep 17 00:00:00 2001 From: ww1516123 Date: Tue, 14 Jun 2022 15:04:43 +0800 Subject: Fix the problem of multi arguments calculation (#1253) --- calc.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'calc.go') diff --git a/calc.go b/calc.go index a485a61..7e89502 100644 --- a/calc.go +++ b/calc.go @@ -899,6 +899,13 @@ func (f *File) evalInfixExp(sheet, cell string, tokens []efp.Token) (formulaArg, if result.Type == ArgUnknown { return newEmptyFormulaArg(), errors.New(formulaErrorVALUE) } + // when thisToken is Range and nextToken is Argument and opfdStack not Empty, should push value to opfdStack and continue. + if nextToken.TType == efp.TokenTypeArgument { + if !opfdStack.Empty() { + opfdStack.Push(result) + continue + } + } argsStack.Peek().(*list.List).PushBack(result) continue } -- cgit v1.2.1