def a1_to_rowcol(label):
 m = CELL_ADDR_RE.match(label)
 if m:
  column_label = m.group(1).upper()
  row = int(m.group(2))
  col = 0
  for (i, c) in enumerate(reversed(column_label)):
   col += ((ord(c) - MAGIC_NUMBER) * (26 ** i))
 else:
  raise IncorrectCellLabel(label)
 return (row, col)

def a1_to_rowcol ( label ) : m = CELL_ADDR_RE . match ( label ) if m : column_label = m . group ( 1 ) . upper ( ) row = int ( m . group ( 2 ) ) col = 0 for ( i , c ) in enumerate ( reversed ( column_label ) ) : col += ( ( ord ( c ) - MAGIC_NUMBER ) * ( 26 ** i ) ) else : raise IncorrectCellLabel ( label ) return ( row , col )
translates a cells address in a1 notation to a tuple of integers .