def column_index_to_integer(col):
    """Convert XLS-style column index into equivalent integer

    Given a column index e.g. 'A', 'BZ' etc, converts it
    to the integer equivalent using zero-based counting
    system (so 'A' is equivalent to zero, 'B' to 1 etc).

    """
    # Convert column index e.g. 'A', 'BZ' etc to
    # integer equivalent
    idx = 0
    i = 0
    for c in col[::-1]:
        idx = idx + pow(26,i)*(ord(c)-64)
        i += 1
    return idx-1