public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) {int maxN = args.length;if(maxN < 1) {return ErrorEval.VALUE_INVALID;}ValueEval firstArg = args[0];try {if(firstArg instanceof NumericValueEval) {return evaluateSingleProduct(args);}if(firstArg instanceof RefEval) {return evaluateSingleProduct(args);}if (firstArg instanceof TwoDEval) {TwoDEval ae = (TwoDEval) firstArg;if(ae.isRow() && ae.isColumn()) {return evaluateSingleProduct(args);}return evaluateAreaSumProduct(args);}} catch (EvaluationException e) {return e.getErrorEval();}throw new RuntimeException("Invalid arg type for SUMPRODUCT: ("+ firstArg.getClass().getName() + ")");}

public ValueEval Evaluate(ValueEval[] args, int srcCellRow, int srcCellCol){int maxN = args.Length;if (maxN < 1){return ErrorEval.VALUE_INVALID;}ValueEval firstArg = args[0];try{if (firstArg is NumericValueEval){return EvaluateSingleProduct(args);}if (firstArg is RefEval){return EvaluateSingleProduct(args);}if (firstArg is TwoDEval){TwoDEval ae = (TwoDEval)firstArg;if (ae.IsRow && ae.IsColumn){return EvaluateSingleProduct(args);}return EvaluateAreaSumProduct(args);}}catch (EvaluationException e){return e.GetErrorEval();}throw new RuntimeException("Invalid arg type for SUMPRODUCT: ("+ firstArg.GetType().Name + ")");}
