def colx_to_int(colx):
    """Converts alpha/decimal str to int for column specifiers.

        Eg. 'AB' becomes 52.
        """
    if isinstance(colx, str):
        if colx.isalpha():
            result = 0
            factor = 1
            for char in colx[::-1]:
                result += (ord(char.upper()) - 64) * factor
                factor *= 26
            colx = result - 1
        elif colx.isdecimal():
            return int(colx)
    return colx
