Find Excel column number from column title | Returns resul when we pass title ; This process is similar to binary - to - decimal conversion ; Driver Code
function titleToNumber ( s ) { let result = 0 ; for ( let i = 0 ; i < s . length ; i ++ ) { result *= 26 ; result += s [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) + 1 ; } return result ; } document . write ( titleToNumber ( " " ) ) ;