final ArrayDescriptor desc = _range.arrayDescriptor();
final int iRow = valueToIntOrOne( _rowIndex ) - 1;
final int iCol = valueToIntOrOne( _colIndex ) - 1;
int iValue;
if (iRow < 0 || iRow >= desc.numberOfRows())
throw new FormulaException( "#VALUE/REF! because row out of range in INDEX" );
if (iCol < 0 || iCol >= desc.numberOfColumns())
throw new FormulaException( "#VALUE/REF! because column out of range in INDEX" );
if (null != _rowIndex && null != _colIndex) {
iValue = iRow * desc.numberOfColumns() + iCol;
}
else {
iValue = iRow + iCol;