def cell_to_packed_rowcol(cell)
    row, col, row_rel, col_rel = cell_to_rowcol(cell)

    exit "Column #{cell} greater than IV in formula\n" if col >= 256
    exit "Row #{cell} greater than 65536 in formula\n" if row >= 65536

    # Set the high bits to indicate if row or col are relative.
    col    |= col_rel << 14
    col    |= row_rel << 15

    row     = [row].pack('v')
    col     = [col].pack('v')

    [row, col]
  end
def cell_to_packed_rowcol(cell)
    row, col, row_rel, col_rel = cell_to_rowcol(cell)

    exit "Column #{cell} greater than IV in formula\n" if col >= 256
    exit "Row #{cell} greater than 65536 in formula\n" if row >= 65536

    # Set the high bits to indicate if row or col are relative.
    col    |= col_rel << 14
    col    |= row_rel << 15

    row     = [row].pack('v')
    col     = [col].pack('v')

    [row, col]
  end
pack() row and column into the required 3 byte format.