def colcode_to_colnum(colcode):
    """Convert Excel style column ids (A, BB, XFD, ...) to a column number."""
    if len(colcode) == 0:
        return 0
    else:
        return (ord(colcode[-1]) - ord('A') + 1) + \
            (26 * colcode_to_colnum(colcode[:-1]))