def col_by_name(colname):
 col = 0
 pow = 1
 for i in xrange((len(colname) - 1), (-1), (-1)):
  ch = colname[i]
  col += (((ord(ch) - ord('A')) + 1) * pow)
  pow *= 26
 return (col - 1)

def col_by_name ( colname ) : col = 0 pow = 1 for i in xrange ( ( len ( colname ) - 1 ) , ( - 1 ) , ( - 1 ) ) : ch = colname [ i ] col += ( ( ( ord ( ch ) - ord ( 'A' ) ) + 1 ) * pow ) pow *= 26 return ( col - 1 )
a -> 0 .