Power Query Problems

Generate Warehouse Location Code Sequences in Excel with Power Query

Muhammad TalhaMuhammad Talha Nov 12, 2026 869 views

Question details

The user needs to generate and refresh warehouse location codes that combine rack identifiers, levels A through E, and positions 01 through 10.

Product
Microsoft Excel Power Query and formulas
Device & OS
not provided
Scenario
Warehouse location codes must repeat the same five levels and ten two-digit positions for multiple rack roots, such as AA01A01 through AA01E10.
Observed behavior
A structured list of location codes is required, with 50 codes generated for each rack root and the ability to refresh the list when rack roots change.
Before you start

Place each rack root, such as AA01, in its own row of a source table and confirm that the required levels are A through E and the positions are 1 through 10. Decide whether the final list should remain refreshable or be converted to static values.

Solution 1Recommended

Generate and refresh the warehouse codes with Excel Power Query

Use this method when the rack-root list changes regularly and the output should refresh from a source table.

Power Query can create a cross-joined list of rack roots, level letters, and position numbers. Formatting the position as two digits preserves values such as 01 and 10.

1
Create the rack-root source table

Enter one rack root per row, select the range, choose Insert > Table, and name the table, for example, RackRoots.

2
Load the table into Power Query

Select any cell in the table and choose Data > From Table/Range to open the Power Query Editor.

3
Create the level and position lists

In Power Query, create one query containing the letters A, B, C, D, and E and another query containing the numbers 1 through 10. Format the position column as text with two digits, such as 01.

4
Combine the three lists

Add a custom key column with the same value in all three queries, such as 1, then use Home > Merge Queries or a cross-join pattern to combine rack roots, levels, and positions.

5
Build and refresh the code column

Choose Add Column > Custom Column and concatenate the rack root, level, and formatted position. Select Home > Close & Load, then use Data > Refresh All whenever the source rack list changes.

Expected pattern: Each rack root produces 50 codes: five levels multiplied by ten positions, for example AA01A01 through AA01E10.

Create warehouse location code sequences in WPS Spreadsheet

WPS Spreadsheet can generate the repeating rack, level, and position pattern with formulas, fill the sequence for each rack root, and convert the results to values for a fixed warehouse list. It provides a familiar spreadsheet workflow while maintaining compatibility with Microsoft Excel files.

  1. 1. Prepare rack roots: Open WPS Spreadsheet, enter one rack root per row in column A, and create headers such as Rack Root, Level, Position, and Location Code.
  2. 2. Generate levels and positions: In the Level column, use =CHAR(65+INT((ROW()-ROW($B$2))/10)); in the Position column, use =TEXT(MOD(ROW()-ROW($C$2),10)+1,"00"). Fill both formulas down 50 rows for each rack.
  3. 3. Combine the code: In the Location Code column, enter =A$2&B2&C2, then press Enter and drag the fill handle down to create codes such as AA01A01 through AA01E10.
  4. 4. Create additional rack blocks: Copy the completed 50-row block, replace the rack root in column A with the next identifier, and repeat until all warehouse racks are included.
  5. 5. Freeze the final list: Select the generated codes, choose Home > Copy, then use Paste Special > Values to keep a static list when formula updates are no longer needed.
Generate 50 warehouse codes per rack root with level and two-digit position formulasUse familiar fill, concatenate, and Paste Special commands without complex setupOpen and save Microsoft Excel XLSX and XLS files with compatible formattingCreate a refreshable formula-based template that can be reused for new rack identifiers
microsoft office alternative - wps office

Frequently Asked Questions

How many location codes does each rack root generate?

Each rack root generates 50 codes because it uses five levels, A through E, and ten positions, 01 through 10.

How can I keep the position numbers as 01 instead of 1?

Use the TEXT function with a two-digit format: =TEXT(number,"00"). In Power Query, set the position value to text and apply a two-digit format before combining the columns.

Can I add more rack roots without rebuilding the sequence?

Yes. Add the new rack root to the source table and refresh the Power Query output. With formulas, copy the 50-row block, replace its rack root, and fill the code column.

How do I create a static warehouse list after generating the formulas?

Select the completed code range, choose Copy, open Paste Special, and select Values. This replaces the formulas with their current text results.

Can the sequence use more or fewer levels than A through E?

Yes. Adjust the level formula or Power Query level list to match the required letters, and change the number of generated rows to the number of levels multiplied by the number of positions.