In Google Sheets, you can use formulas to generate more than just calculations—you can also build patterns. A great example is the 1-12-123-1234 number triangle pattern, where each row grows by one number:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
In this tutorial, I’ll show you how to generate this number triangle (the 1-12-123-1234 pattern) in Google Sheets using a single, dynamic array formula. Once set up, the triangle grows automatically, so you don’t have to type each row manually.
Two Formula Options to Create a Number Triangle Pattern in Google Sheets
You can use either a regular array formula or a LAMBDA-based formula to generate the 1-12-123-1234 pattern in Google Sheets. We’ll explore both methods so you can choose the one you prefer.
Option 1 – 1-12-123-1234 Pattern Using SEQUENCE and a Logical Test
Open an empty sheet and enter this formula into a cell (for example, B2):
=ArrayFormula(
IF(
SEQUENCE(10, 10)^0 + SEQUENCE(1, 10, 0) <= SEQUENCE(10),
SEQUENCE(1, 10),
)
)
This creates a left-aligned number triangle (also called an increasing triangle pattern) inside a 10 × 10 matrix.

👉 To expand it, replace all 10s with 15 to generate a 15 × 15 matrix.
Formula Explanation
Let’s split the formula into two parts:
Part 1:
SEQUENCE(10, 10)^0→ creates a 10 × 10 matrix filled with 1s.+ SEQUENCE(1, 10, 0)→ turns that matrix into column numbers from 1 to 10, repeated down each row.
Part 2:
SEQUENCE(10)→ generates a vertical sequence from 1 to 10.
The formula then compares each value in Part 1 with the corresponding row value in Part 2. The result is a grid of TRUE and FALSE values, for example:
TRUE FALSE FALSE FALSE ...
TRUE TRUE FALSE FALSE ...
TRUE TRUE TRUE FALSE ...
TRUE TRUE TRUE TRUE ...
...
Every TRUE means “yes, include this number.”
Finally, the formula uses that logical test to return values from SEQUENCE(1, 10). That’s how you end up with:
1
1 2
1 2 3
1 2 3 4
...
— the 1-12-123-1234 number triangle pattern.
Option 2 – 1-12-123-1234 Pattern Using MAP and LAMBDA
Here’s another way to build the triangle using the MAP function with LAMBDA:
=MAP(SEQUENCE(10), LAMBDA(r, TOROW(CHOOSEROWS(SEQUENCE(10), SEQUENCE(r)))))
This also creates a 10 × 10 number triangle.
👉 Replace 10 with n to generate an n × n matrix.
Formula Explanation
SEQUENCE(10)→ generates a vertical sequence from 1 to 10.MAP(SEQUENCE(10), LAMBDA(r, ...))→ applies a function to each row numberr.- Inside the LAMBDA:
CHOOSEROWS(SEQUENCE(10), SEQUENCE(r))→ selects the first r rows from the sequence 1–10.TOROW(...)→ converts those values into a single row.
This builds the same 1-12-123-1234 triangle pattern row by row.
Additional Tip: Number Triangle Pattern with a Custom Array
You can also build a number triangle using your own list of values instead of a simple sequence.
- In Option 1, replace
SEQUENCE(1, 10)(at the end of the formula) withTRANSPOSE(A2:A11)(assuming your custom values are in columnA). - In Option 2, replace
SEQUENCE(10)insideCHOOSEROWSwithA2:A11.

This way, you can generate number patterns from any dataset. The resulting arrays can also be transposed and used with database functions like DMIN or DMAX for running min/max calculations.