Function Problems

How to Repeat ZIP Codes Based on Ticket Counts in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 11, 2026 869 views

Question details

The user needs to create a dynamic formula to repeat individual ZIP codes multiple times corresponding to their ticket count, filtered by a specific day of the week.

How to Repeat ZIP Codes Based on Ticket Counts in Excel
Product
Excel
Device & OS
not provided
Scenario
Expanding aggregated daily data into a detailed itemized list, where each row represents a single ticket tied to its respective ZIP code.
Observed behavior
Using dynamic array formulas, the summary table is successfully expanded into a full list showing the properly repeated ZIP codes.
Before you start

Verify that your version of Excel or WPS Spreadsheet supports modern dynamic array functions such as FILTER, SCAN, XLOOKUP, and SEQUENCE.

Solution 1Recommended

Use LET, FILTER, and XLOOKUP Dynamic Array Functions

This method combines several dynamic functions to filter the target day's data, calculate cumulative totals, and repeat the ZIP codes the necessary number of times.

This formula filters the data for a selected day, creates a cumulative total of the ticket counts, and matches a generated sequence to return each ZIP code precisely the required number of times.

1
Identify Data Ranges

Locate your ticket counts (e.g., A1:A5), ZIP codes (B1:B5), day of the week (C1:C5), and the cell containing your target day (e.g., E1).

2
Enter the Formula

Select the empty cell where you want the new list to begin and enter the following formula: =LET(f_amoti,FILTER(A1:A5,C1:C5=E1),f_zipc,FILTER(B1:B5,C1:C5=E1),XLOOKUP(SEQUENCE(SUM(f_amoti)),SCAN(0,f_amoti,LAMBDA(a,b,SUM(a,b))),f_zipc,"",1))

3
Generate the Results

Press Enter. The formula will automatically calculate and spill downwards, repeating the ZIP codes based on their respective ticket counts.

Use LET, FILTER, and XLOOKUP Dynamic Array Functions
Avoid #SPILL! Errors: Ensure that the column below your formula is completely empty so the dynamic array has enough space to expand.

Process Dynamic Data Easily with WPS Spreadsheet

WPS Office offers robust support for complex dynamic array formulas such as XLOOKUP, FILTER, and SCAN, making advanced data manipulation straightforward and highly efficient.

  1. 1. Open Your Spreadsheet: Launch WPS Spreadsheet and open the file containing your aggregated ticket and ZIP code data.
  2. 2. Apply the Formula: Select the destination cell and input the LET or custom LAMBDA dynamic array formula to expand your data.
  3. 3. View Expanded Results: Press Enter, and WPS Spreadsheet will instantly process the array, properly displaying the repeated values down your column.
100% compatibility with advanced Microsoft Excel dynamic array formulas.Free to use, offering a lightweight yet powerful alternative for data analysis.Familiar user interface ensuring zero learning curve when migrating.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my dynamic formula returning a #NAME? error?

The #NAME? error typically appears if your current spreadsheet version does not support newer dynamic array functions like SCAN, LET, or XLOOKUP. Check for updates or switch to a compatible application like WPS Spreadsheet.

How do I fix the #SPILL! error when repeating values?

The #SPILL! error means there is existing data blocking the formula's downward expansion. Simply clear the cells directly below your formula to provide enough room for the generated list.

Can I modify this formula to repeat other data types?

Yes, you can easily adapt this formula. Replace the ZIP code column reference with the range containing the data you want to repeat, such as product names, tracking numbers, or employee IDs.