Beispiel #1
0
        public ValueEval Evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
        {
            int nArgs = args.Length;

            if (nArgs < 1)
            {
                // too few arguments
                return(ErrorEval.VALUE_INVALID);
            }

            if (nArgs > 30)
            {
                // too many arguments
                return(ErrorEval.VALUE_INVALID);
            }

            int temp = 0;

            // Note - observed behavior of Excel:
            // Error values like #VALUE!, #REF!, #DIV/0!, #NAME? etc don't cause this COUNTA to return an error
            // in fact, they seem to Get Counted

            for (int i = 0; i < nArgs; i++)
            {
                temp += CountUtils.CountArg(args[i], _predicate);
            }
            return(new NumberEval(temp));
        }
Beispiel #2
0
        public ValueEval Evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
        {
            int nArgs = args.Length;

            if (nArgs < 1)
            {
                // too few arguments
                return(ErrorEval.VALUE_INVALID);
            }

            if (nArgs > 30)
            {
                // too many arguments
                return(ErrorEval.VALUE_INVALID);
            }

            int temp = 0;

            for (int i = 0; i < nArgs; i++)
            {
                temp += CountUtils.CountArg(args[i], _predicate);
            }
            return(new NumberEval(temp));
        }