Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. def col_to_int(col):
  2. """Converts excel COL to INT (zero indexed)"""
  3. if len(col) == 1:
  4. return ord(col.upper()) - ord('A')
  5. if len(col) == 2:
  6. n_alphabet = 26
  7. return (col_to_int(col[0])+1)*n_alphabet+col_to_int(col[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement