Find Excel column number from column title | Java program to return title to result of excel sheet . ; Returns resul when we pass title . ; This process is similar to binary - to - decimal conversion ; Driver Code
import java . util . * ; import java . lang . * ; class GFG { static int titleToNumber ( String s ) { int result = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { result *= 26 ; result += s . charAt ( i ) - ' A ' + 1 ; } return result ; } public static void main ( String [ ] args ) { System . out . print ( titleToNumber ( " CDA " ) ) ; } }