public ValueEval Evaluate(ValueEval[] args, int srcCellRow, int srcCellCol){if (args.Length < 3 || args.Length > 5){return ErrorEval.VALUE_INVALID;}try{BaseRef baseRef = EvaluateBaseRef(args[0]);int rowOffset = EvaluateIntArg(args[1], srcCellRow, srcCellCol);int columnOffset = EvaluateIntArg(args[2], srcCellRow, srcCellCol);int height = baseRef.Height;int width = baseRef.Width;switch (args.Length){case 5:width = EvaluateIntArg(args[4], srcCellRow, srcCellCol);break;case 4:height = EvaluateIntArg(args[3], srcCellRow, srcCellCol);break;}if (height == 0 || width == 0){return ErrorEval.REF_INVALID;}LinearOffsetRange rowOffsetRange = new LinearOffsetRange(rowOffset, height);LinearOffsetRange colOffsetRange = new LinearOffsetRange(columnOffset, width);return CreateOffset(baseRef, rowOffsetRange, colOffsetRange);}catch (EvaluationException e){return e.GetErrorEval();}}