How to Generate a Repeating Number Pattern with SEQUENCE in WPS Spreadsheet
Question details
The user needs a dynamic array formula that creates a repeating four-value pattern—1, 2, 1, 2, 3, 4, 3, 4—and continues upward by two for each group.

- Product
- WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Creating a repeating number sequence for tasks such as data simulation, labeling, or testing formulas without dragging the fill handle.
- Observed behavior
- The intended result is a horizontal spill that repeats each pair of consecutive numbers and then increases the starting number by two for the next group.
Make sure your WPS Office version supports dynamic array functions such as SEQUENCE and TOROW. Open the workbook and select an empty row or range where the spilled sequence can appear without overwriting existing data.
Use TOROW with SEQUENCE to Spill the Repeating Pair Pattern
Best for a single-cell dynamic array formula when your WPS Spreadsheet version supports SEQUENCE and TOROW.
The formula creates a vertical sequence of group offsets—0, 2, 4, 6—and adds the horizontal base pattern {1,2,1,2} to each offset. TOROW then reads the resulting matrix row by row, so the pattern repeats and increases by two after every four values.
Open your workbook in WPS Spreadsheet and click a blank cell, such as A1, where the horizontal sequence should begin.
Type =TOROW({1,2,1,2}+SEQUENCE(n,,0,2)) and replace n with the number of four-value groups you need. For example, =TOROW({1,2,1,2}+SEQUENCE(4,,0,2)) returns 1, 2, 1, 2, 3, 4, 3, 4, 5, 6, 5, 6, 7, 8, 7, 8.
Press Enter. WPS Spreadsheet spills the generated values into adjacent cells to the right, starting from the selected cell.

Use a Column-Based Formula When Dynamic Array Spill Is Unavailable
Use this approach in older WPS Spreadsheet builds or when you need to fill the pattern by copying across a row.
Create Repeating Number Patterns in WPS Spreadsheet with Dynamic Array Formulas
WPS Spreadsheet lets you build the same repeating sequence with SEQUENCE and TOROW in one formula. Open your workbook, enter the formula, and let dynamic arrays spill the pattern across the row—no manual fill required.
- 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open the worksheet where you want the repeating pattern to appear.
- 2. Select a blank cell: Click a blank cell, such as A1, where the horizontal sequence should start.
- 3. Enter the dynamic array formula: Type =TOROW({1,2,1,2}+SEQUENCE(n,,0,2)) and replace n with the number of four-value groups required.
- 4. Press Enter and let WPS spill the pattern: Press Enter. WPS Spreadsheet automatically fills the repeating pattern across adjacent cells to the right.

Frequently Asked Questions
Why does my formula return only four values instead of the full repeating pattern?
You may have entered SEQUENCE(1,n,0,2) with a horizontal base array. Use =TOROW({1,2,1,2}+SEQUENCE(n,,0,2)) so the vertical group offsets broadcast against {1,2,1,2} and TOROW flattens the resulting matrix.
Can I generate this repeating pattern vertically instead of horizontally?
Yes. Replace TOROW with TOCOL, for example =TOCOL({1,2,1,2}+SEQUENCE(n,,0,2)), to spill the same pattern downward in WPS Spreadsheet.
What does the n argument control in the formula?
The n argument is the number of four-value groups. For 16 total values, use n=4; for 8 total values, use n=2.
Does WPS Spreadsheet support dynamic array functions like SEQUENCE and TOROW?
Current versions of WPS Office support dynamic array functions such as SEQUENCE, TOROW, and TOCOL. If your version does not have them, update WPS Office or use the column-based formula in this article.
How can I make the pattern start at a different number?
Change the start argument in SEQUENCE. For example, =TOROW({1,2,1,2}+SEQUENCE(n,,4,2)) starts each group at 5 and produces 5, 6, 5, 6, 7, 8, 7, 8, and so on.




