def cmp_column_indices(x,y):
    """Comparision function for column indices

    x and y are XLS-style column indices e.g. 'A', 'B', 'AA' etc.

    Returns -1 if x is a column index less than y, 1 if it is
    greater than y, and 0 if it's equal.

    """
    # Do string comparision on reverse of column indices
    return (x[::-1] > y[::-1]) - (x[::-1] < y[::-1])