Find Excel column name from a given column number |  ; Step 1 : Converting to number assuming 0 in number system ; Step 2 : Getting rid of 0 , as 0 is not part of number system ; Driver code
def printString ( n ) : NEW_LINE INDENT arr = [ 0 ] * 10000 NEW_LINE i = 0 NEW_LINE while ( n > 0 ) : NEW_LINE INDENT arr [ i ] = n % 26 NEW_LINE n = int ( n // 26 ) NEW_LINE i += 1 NEW_LINE DEDENT for j in range ( 0 , i - 1 ) : NEW_LINE INDENT if ( arr [ j ] <= 0 ) : NEW_LINE INDENT arr [ j ] += 26 NEW_LINE arr [ j + 1 ] = arr [ j + 1 ] - 1 NEW_LINE DEDENT DEDENT for j in range ( i , - 1 , - 1 ) : NEW_LINE INDENT if ( arr [ j ] > 0 ) : NEW_LINE INDENT print ( chr ( ord ( ' A ' ) + ( arr [ j ] - 1 ) ) , end = " " ) ; NEW_LINE DEDENT DEDENT print ( ) ; NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT printString ( 26 ) ; NEW_LINE printString ( 51 ) ; NEW_LINE printString ( 52 ) ; NEW_LINE printString ( 80 ) ; NEW_LINE printString ( 676 ) ; NEW_LINE printString ( 702 ) ; NEW_LINE printString ( 705 ) ; NEW_LINE DEDENT