def cell_to_packed_rowcol(cell):
 (row, col, row_abs, col_abs) = cell_to_rowcol(cell)
 if (col >= MAX_COL):
  raise Exception(('Column %s greater than IV in formula' % cell))
 if (row >= MAX_ROW):
  raise Exception(('Row %s greater than %d in formula' % (cell, MAX_ROW)))
 col |= (int((not row_abs)) << 15)
 col |= (int((not col_abs)) << 14)
 return (row, col)

def cell_to_packed_rowcol ( cell ) : ( row , col , row_abs , col_abs ) = cell_to_rowcol ( cell ) if ( col >= MAX_COL ) : raise Exception ( ( 'Column %s greater than IV in formula' % cell ) ) if ( row >= MAX_ROW ) : raise Exception ( ( 'Row %s greater than %d in formula' % ( cell , MAX_ROW ) ) ) col |= ( int ( ( not row_abs ) ) << 15 ) col |= ( int ( ( not col_abs ) ) << 14 ) return ( row , col )
pack row and column into the required 4 byte format .