code: public static long fromAlpha(String s) {
          s = s.trim().toUpperCase();
          if (s.isEmpty()) throw new IllegalArgumentException(
                  "Empty string not allowed");
          long result = 0;
          for (char c: s.toCharArray()) {
              if (c < 'A' || c > 'Z')
                  throw new IllegalArgumentException(
                          "Invalid character '" + c + "'");
              result = result*26 + (c - 'A' + 1);
              if (result < 0)
                  throw new IllegalArgumentException(
                          "\"" + s + "\" is too large.");
          }
          return result-1;
      }
docs: Converts an alpha-index into a number.
  <pre>
  A ->   0
  B ->   1
  Z ->  25
  AA ->  26
  AB ->  27
  AAA -> 702
  </pre>
  Maximum value is {@code "CRPXNLSKVLJFHG"} (or {@code Long.MAX_VALUE-1})
  <p>
  All characters of {@code s} have to be between {@code 'A'} and
  {@code 'Z'}, in upper or lower case.
  @param s alpha-index
  @return value of {@code s}
  @see Long#MAX_VALUE