assertMinArgCount(args, 3);
assertMaxArgCount(args, 5);
Expr r = args[0];
if (!(r instanceof ExprVariable)) {
throw new ExprException("First argument to OFFSET not a reference");
}
ExprVariable ref = (ExprVariable) r;
Range range = (Range) ref.getAnnotation();
if (range == null) {
range = Range.valueOf(ref.getName());
}
if (range == null) {
throw new ExprException("First argument to OFFSET not a reference");
}
GridReference gf = range.getDimension1();
int x = gf.getColumn();
int y = gf.getRow();
int rows = asInteger(args[1], true);