Explanation

In this example, the goal is to repeat a range of values.

Both functions work natively with two-dimensional ranges and can accept a single array of numeric index numbers.

The formulas below work in two steps:

Step 1 is based on the formulaexplained in detail here.

Example of repeating a two-dimensional range

This is done with theSEQUENCE functionand theMOD functionhere:

This code creates a single array of repeating numbers.

TheCHOOSECOLS functionis designed to return specificcolumnsfrom a range.

The array can be one dimensional, or two-dimensional, determined byrowsandcolumnsarguments.

Example of repeating a two-dimensional range

MOD Function

The Excel MOD function returns the remainder of two numbers after division.

For example, MOD(10,3) = 1.

The result of MOD carries the same sign as the divisor.

Example of repeating a two-dimensional range

CHOOSEROWS Function

The Excel CHOOSEROWS function returns specific rows from an array or range.

The rows to return are provided as numbers in separate arguments.

Each number corresponds to the numeric index of a row in the given array.

Example of repeating a two-dimensional range

CHOOSECOLS Function

The Excel CHOOSECOLS function returns specific columns from an array or range.

The columns to return are provided as numbers in separate arguments.

Each number corresponds to the numeric index of a column in the given array.

Example of repeating a two-dimensional range

The SEQUENCE function

Example of repeating a range into columns

Excel formula: Repeat sequence of numbers

Excel formula: Repeat fixed value every 3 months

Excel SEQUENCE function

Excel MOD function

Excel CHOOSEROWS function

Excel CHOOSECOLS function

Article image

Example of repeating a two-dimensional range

Example of repeating a range into columns