Convert a Column Number to an Excel-Style Label

Read the full interview experience this question came from →

Quick Overview

Convert one-based spreadsheet columns into A-through-Z and AA-through-ZZ labels, with correct handling of multiples of 26.

Convert a Column Number to an Excel-Style Label

Company: Houzz

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Online Assessment

Convert a one-based spreadsheet column number into its Excel-style column label. Columns 1 through 26 are `A` through `Z`; column 27 is `AA`, and the sequence continues through `ZZ` at column 702. Implement `column_label(n: int) -> string` and return the label as an uppercase string. ### Constraints & Assumptions - `n` is an integer in the inclusive range 1 through 702. - This is a column label only; do not append a row number. - The numbering is one-based. There is no zero digit and no label for column zero. - The input is valid; error handling for out-of-range values is outside this callable's contract. ### Examples - `column_label(26)` returns `"Z"`. - `column_label(27)` returns `"AA"`. ```hint Account for the missing zero digit Before taking a remainder by 26, align the current one-based position with the zero-based offsets used to select letters from A through Z. ```

Overview: Convert one-based spreadsheet columns into A-through-Z and AA-through-ZZ labels, with correct handling of multiples of 26.

Read the full Houzz Software Engineer interview experience this question came from

|Home/Coding & Algorithms/Houzz
Houzz logo
Houzz
Sep 18, 2026
mediumSoftware EngineerOnline AssessmentCoding & Algorithms
0
0

Convert a one-based spreadsheet column number into its Excel-style column label. Columns 1 through 26 are A through Z; column 27 is AA, and the sequence continues through ZZ at column 702.

Implement column_label(n: int) -> string and return the label as an uppercase string.

Constraints & Assumptions

  • n is an integer in the inclusive range 1 through 702.
  • This is a column label only; do not append a row number.
  • The numbering is one-based. There is no zero digit and no label for column zero.
  • The input is valid; error handling for out-of-range values is outside this callable's contract.

Examples

  • column_label(26) returns "Z" .
  • column_label(27) returns "AA" .

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...