function excelColumnIndexAsLetter(n) {
    var cs = 'A'.charCodeAt(0);
    var len = 26;
    var s = "";
    while (n >= 0) {
        s = String.fromCharCode(n % len + cs) + s;
        n = Math.floor(n / len) - 1;
    }
    return s;
}

document.writeln(excelColumnIndexAsLetter(0)+',')
document.writeln(excelColumnIndexAsLetter(26)+',')
document.writeln(excelColumnIndexAsLetter(52)+',')
document.writeln(excelColumnIndexAsLetter(999)+',')
document.writeln(excelColumnIndexAsLetter(99999))