HomeGoogle DocsSpreadsheetHow to Create a Number Triangle Pattern in Google Sheets

How to Create a Number Triangle Pattern in Google Sheets

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.

Google Sheets number triangle formula creating a left-aligned 1-12-123-1234 pattern

👉 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 number r.
  • 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) with TRANSPOSE(A2:A11) (assuming your custom values are in column A).
  • In Option 2, replace SEQUENCE(10) inside CHOOSEROWS with A2:A11.
Google Sheets number triangle formula using custom values from column A instead of sequential numbers

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.

Prashanth K V
Prashanth K V
Your Trusted Google Sheets and Excel Expert Prashanth K V is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

How to Build a Road Trip Fuel Cost Splitter Formula in Google Sheets

Need a fair formula to split fuel costs among travelers on a long road...

Road Trip Fuel Cost Splitter in Google Sheets (Free Template)

When you go on a long road trip with friends, splitting fuel expenses fairly...

Savings Tracker Template in Google Sheets (Free Download)

Managing multiple savings goals can become difficult without a proper system to track your...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.