def col2int(colstr):
    """ Converts column literal to number (eg. 'AA' = 27, 'AAA' = 703 etc.) """
    res = 0
    for i, s in enumerate(colstr.upper()[::-1]):
        res += (ord(s)-64)*(26**i)

    return res