Skip to content

Excel Sheet Column Number

EasyBit Manipulation & Math
Decode it first. Clues, constraints, pattern and plan before any code.

Spreadsheet columns are labelled A, B, ..., Z, AA, AB, ..., AZ, BA, .... Given a column title, return its column number (A is 1, Z is 26, AA is 27).

columnTitle = "A"   →  1
columnTitle = "AB"  →  28
columnTitle = "ZY"  →  701

Constraints

  • 1 <= columnTitle.length <= 7
  • columnTitle contains only uppercase English letters.
  • columnTitle is in the range ["A", "FXSHRXW"].