2
\$\begingroup\$

Spreadsheet Columns

In most spreadsheet programs, columns go A, B, C, ... X, Y, Z. After this comes AA, AB, AC ... AX, AY, AZ, BA and so on.

Your task is to convert one of these strings in to a column number. You must support inputs up to the maximum length of your language, to a minimum of 3.

Test Cases:

A   => 1
B   => 2
Z   => 26
AA  => 27
AC  => 29
AZ  => 52
BA  => 53
FC  => 159
ID  => 238
AAA => 703

Standard loopholes are forbidden.

\$\endgroup\$
  • \$\begingroup\$ Related, borderline dupe. \$\endgroup\$ – Shaggy Oct 3 '19 at 18:18
  • \$\begingroup\$ Also a subset of this challenge, which would probably be a better dupe target. \$\endgroup\$ – Shaggy Oct 3 '19 at 18:19
  • \$\begingroup\$ @Shaggy you were one step away from the exact dupe :-) \$\endgroup\$ – Giuseppe Oct 3 '19 at 18:21
  • 1
    \$\begingroup\$ @gadzooks02 yes, alas, a good challenge but one already done. Feel free to post in The Sandbox to get feedback if you want any; this can sometimes help catch dupes, although sometimes challenges just languish there for way too long. In that case, drawing additional attention to it in chat can help as well. \$\endgroup\$ – Giuseppe Oct 3 '19 at 18:31
  • 3
    \$\begingroup\$ Um, you did put this in the Sandbox, where I told you it was a dupe. What's the point of ignoring feedback? \$\endgroup\$ – Jo King Oct 3 '19 at 21:10