def get_column_string(n):
    """Converts index n to a letter-based column index as is used in Google Sheets."""
    chars = []
    a = ord('A')
    while n > 0:
        n, offset = divmod(n-1, 26)
        chars.append(chr(a + offset))
    return "".join(reversed(chars))