Disappearing REPEAT() function

GSM54321

New Member
Joined
Jan 4, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
In late 2022 (probably Oct or Nov) I discovered REPEAT() as a function in Excel. It would generate a new array where the input range was duplicated with the specified number of vertical and horizontal repeats. For example, =REPEAT(A1:B1,3,4) would generate an array of 6 rows and 4 columns where there were interlaced rows with the values A1 and B1 respectively, repeated in 4 columns where the values of the 2nd, 3rd, and 4th columns were equal to the values in the first column. I was using Office Insider channel at the time (unsure of what build) and incorporated REPEAT() into some of my spreadsheets.

I noticed it was no longer available while using OFFICE INSIDER Version 2301 Build 16026.20002. Trying to use REPEAT() gives a #NAME error. (FWIW, REPT() is available, but it's obviously a completely different task.) I'm using 2302 INSIDER Build 16110.20000 and it remains an unavailable function.

Multiple internet searches for only had info on the REPT() function. I was able to do what I needed with a combination of INDEX and sequence, but it was weird to have something that was a built-in function disappear. It was definitely not a user-defined function (nothing in Name Manager as either LAMBDA or UDF.)

Funny thing, my work computer still recognizes REPEAT() -- note the attached screenshot --and functions as the tips imply. My work computer has MS 365 Apps for enterprise Version 2211 (Build 15831.20208) and runs the calculations using REPEAT() as originally written.

This seems very strange. Anyone have any idea what's going on?

Thanks for any insights,

GSM
 

Attachments

  • Excel REPEAT function.jpg
    Excel REPEAT function.jpg
    49.4 KB · Views: 12

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
As far as I know there has never been a Repeat function in Excel. I suspect that it is a UDF possibly in an add-in.
 
Upvote 0
Solution
Here is a lambda function that replicates that function, as far as I can tell.

REPEAT
ABCDEFGHIJKLMN
2Single Column
3ARepeat Rows:3Repeat Rows:3
4BRepeat Columns:1Repeat Columns:2
5CResult:AResult:AA
6BBB
7CCC
8AAA
9BBB
10CCC
11AAA
12BBB
13CCC
14
15Multiple Column
16X1Repeat Rows:3Repeat Rows:3
17Y2Repeat Columns:1Repeat Columns:3
18Z3Result:X1Result:X1X1X1
19Y2Y2Y2Y2
20Z3Z3Z3Z3
21X1X1X1X1
22Y2Y2Y2Y2
23Z3Z3Z3Z3
24X1X1X1X1
25Y2Y2Y2Y2
26Z3Z3Z3Z3
Sheet3
Cell Formulas
RangeFormula
E5:E13E5=REPEAT(A3:A5,E3,E4)
I5:J13I5=REPEAT(A3:A5,I3,I4)
E18:F26E18=REPEAT(A16:B18,E16,E17)
I18:N26I18=REPEAT(A16:B18,I16,I17)
Dynamic array formulas.


Excel Formula:
=LAMBDA(
    range,r_mult,c_mult,
    LET(
        ro,ROWS(range)*r_mult,
        co,COLUMNS(range)*c_mult,
        rx,MOD(TRANSPOSE(SEQUENCE(co,ro,0)),3)+1,
        cx,MAKEARRAY(
            ro,co,
                LAMBDA(
                    r,c,
                    MOD(c-1,COLUMNS(range))+1
                )
            ),
        INDEX(range,rx,cx)))
 
Upvote 0
Small edit to the formula.

Excel Formula:
=LAMBDA(
    range,vertical_repeats,horizontal_repeats,
    LET(
        r_cnt, ROWS(range),
        c_cnt, COLUMNS(range),
        ro,r_cnt*vertical_repeats,
        co,c_cnt*horizontal_repeats,
        rx,MOD(TRANSPOSE(SEQUENCE(co,ro,0)),r_cnt)+1,
        cx,MAKEARRAY(
            ro,co,
                LAMBDA(
                    r,c,
                    MOD(c-1,c_cnt)+1
                )
            ),
        INDEX(range,rx,cx)))
 
Upvote 0
As far as I know there has never been a Repeat function in Excel. I suspect that it is a UDF possibly in an add-in.
Thank you, your guess is correct.

It appears to be a UDF in FastExcel V4. I noticed that some of the modules in FastExcel V4 were inactivated on the computer with the INSIDER version of 365. When I reactivated them the function REPEAT() is available again.

Understandably, the project for the FastExcel add-ins are unviewable, so I am unable to search for UDFs in the add-in.

As a general question, is there an easy way to find out what functions are UDF so that I can be aware of what may not be available if other users don't have the add-in? I guess I could always search the alphabetical list of Excel functions on MS support page when trying a new function.

GSM
 
Upvote 0
Small edit to the formula.

Excel Formula:
=LAMBDA(
    range,vertical_repeats,horizontal_repeats,
    LET(
        r_cnt, ROWS(range),
        c_cnt, COLUMNS(range),
        ro,r_cnt*vertical_repeats,
        co,c_cnt*horizontal_repeats,
        rx,MOD(TRANSPOSE(SEQUENCE(co,ro,0)),r_cnt)+1,
        cx,MAKEARRAY(
            ro,co,
                LAMBDA(
                    r,c,
                    MOD(c-1,c_cnt)+1
                )
            ),
        INDEX(range,rx,cx)))
Thank you lrobbo314 for taking the effort to write and then post this lambda. This is great.

This is a much simpler solution with better generalization than the fix I came up with, which also used MOD, INDEX, SEQUENCE but organized the array with more clumsy implementations of HSTACK and VSTACK.

much appreciated,

GSM
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top