SREPEAT is a simple repeating solution that spills repeats, at the specified number of rows and/or columns, of any single value, including errors or blanks, whether or not enclosed in array brackets
SREPEAT takes three parameters, one required and two optional, as follows:
A) The first parameter, required, specifies the function input and can be any single value/cell
Note that any data type, even errors, can be included as reference (for a full list of all data types, refer to the latest update of XTYPE)
Note that the single input can be in array brackets as well (e.g. {45} or {"book"} or {#DIV/0!})
Note that if more than one value is entered, the function will crash to an #N/A
B) the second parameter, optional, specifies the number of rows of repeats for the input and can be either omitted or any positive number greater than or equal to 1
Note that if this parameter is omitted, the default number of rows will be 1
Note that if a non-integer number is entered, it will be rounded down to the nearest integer
Note that if zero or a number between zero and one is entered, the function will crash to a #CALC! error
Note that the single number of rows can be in array brackets as well (e.g. {12})
Note that if a negative number is entered, the function will crash to a #VALUE! error
Note that if more than one number is entered, the function will crash to an #N/A
Note that if any other value besides a single number is entered, the function will crash to an #N/A
C) the second parameter, optional, specifies the number of columns of repeats for the input and can be either omitted or any positive number greater than or equal to 1
Note that if this parameter is omitted, the default number of columns will be 1
Note that if a non-integer number is entered, it will be rounded down to the nearest integer
Note that if zero or a number between zero and one is entered, the function will crash to a #CALC! error
Note that the single number of columns can be in array brackets as well (e.g. {8})
Note that if a negative number is entered, the function will crash to a #VALUE! error
Note that if more than one number is entered, the function will crash to an #N/A
Note that if any other value besides a single number is entered, the function will crash to an #N/A
Note that both rows and columns can be used simultaneously to generate a 2D spill of repeats
(You can download my template from the link in my signature below, which makes it easier to obtain/test the functions compared to manually pasting from the text/XL2BB)
SREPEAT
IO (Shortened form of ISOMITTED)
SREPEAT takes three parameters, one required and two optional, as follows:
A) The first parameter, required, specifies the function input and can be any single value/cell
Note that any data type, even errors, can be included as reference (for a full list of all data types, refer to the latest update of XTYPE)
Note that the single input can be in array brackets as well (e.g. {45} or {"book"} or {#DIV/0!})
Note that if more than one value is entered, the function will crash to an #N/A
B) the second parameter, optional, specifies the number of rows of repeats for the input and can be either omitted or any positive number greater than or equal to 1
Note that if this parameter is omitted, the default number of rows will be 1
Note that if a non-integer number is entered, it will be rounded down to the nearest integer
Note that if zero or a number between zero and one is entered, the function will crash to a #CALC! error
Note that the single number of rows can be in array brackets as well (e.g. {12})
Note that if a negative number is entered, the function will crash to a #VALUE! error
Note that if more than one number is entered, the function will crash to an #N/A
Note that if any other value besides a single number is entered, the function will crash to an #N/A
C) the second parameter, optional, specifies the number of columns of repeats for the input and can be either omitted or any positive number greater than or equal to 1
Note that if this parameter is omitted, the default number of columns will be 1
Note that if a non-integer number is entered, it will be rounded down to the nearest integer
Note that if zero or a number between zero and one is entered, the function will crash to a #CALC! error
Note that the single number of columns can be in array brackets as well (e.g. {8})
Note that if a negative number is entered, the function will crash to a #VALUE! error
Note that if more than one number is entered, the function will crash to an #N/A
Note that if any other value besides a single number is entered, the function will crash to an #N/A
Note that both rows and columns can be used simultaneously to generate a 2D spill of repeats
(You can download my template from the link in my signature below, which makes it easier to obtain/test the functions compared to manually pasting from the text/XL2BB)
SREPEAT
Excel Formula:
=LAMBDA(reference,[rows],[columns],
LET(
r,IF(reference="","",reference),
a,IF(IO(rows),1,rows),
b,IF(IO(columns),1,columns),
IF(
AND(
IFERROR(ROWS(r),1)=1,
IFERROR(COLUMNS(r),1)=1,
ROWS(IFERROR(a,1))=1,
COLUMNS(IFERROR(a,1))=1,
ROWS(IFERROR(b,1))=1,
COLUMNS(IFERROR(b,1))=1,
ISNUMBER(a),
ISNUMBER(b)
),
IF(
SEQUENCE(INDEX(a,1),INDEX(b,1)),
r,
""
),
NA()
)
)
)
IO (Shortened form of ISOMITTED)
Excel Formula:
=LAMBDA(parameter,
ISOMITTED(parameter)
)
SREPEAT.xlsx | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | |||
1 | |||||||||||||||||||||
2 | #CALC! | ||||||||||||||||||||
3 | |||||||||||||||||||||
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | |||||||||||||
5 | 4 | 4 | 4 | 4 | |||||||||||||||||
6 | 4 | 4 | 4 | 4 | |||||||||||||||||
7 | |||||||||||||||||||||
8 | book | book | book | book | book | book | book | book | |||||||||||||
9 | book | book | book | book | |||||||||||||||||
10 | book | book | book | book | |||||||||||||||||
11 | |||||||||||||||||||||
12 | |||||||||||||||||||||
13 | |||||||||||||||||||||
14 | |||||||||||||||||||||
15 | |||||||||||||||||||||
16 | TRUE | TRUE | TRUE | TRUE | TRUE | TRUE | TRUE | TRUE | |||||||||||||
17 | TRUE | TRUE | TRUE | TRUE | |||||||||||||||||
18 | TRUE | TRUE | TRUE | TRUE | |||||||||||||||||
19 | |||||||||||||||||||||
20 | FALSE | FALSE | FALSE | FALSE | FALSE | FALSE | FALSE | FALSE | |||||||||||||
21 | FALSE | FALSE | FALSE | FALSE | |||||||||||||||||
22 | FALSE | FALSE | FALSE | FALSE | |||||||||||||||||
23 | |||||||||||||||||||||
24 | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | |||||||||||||
25 | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | |||||||||||||||||
26 | #DIV/0! | #DIV/0! | #DIV/0! | #DIV/0! | |||||||||||||||||
27 | |||||||||||||||||||||
28 | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | |||||||||||||
29 | #N/A | #N/A | #N/A | #N/A | |||||||||||||||||
30 | #N/A | #N/A | #N/A | #N/A | |||||||||||||||||
31 | |||||||||||||||||||||
32 | number | text | blank_real | blank_formula | blank_space | blank_pasted | logical | logical | error | error | error | ||||||||||
33 | data type: | 1 | 2 | 31 | 32 | 33 | 34 | 41 | 42 | 162 | 163 | 165 | |||||||||
34 | input: | 11 | note | TRUE | FALSE | #DIV/0! | #VALUE! | #NAME? | |||||||||||||
35 | |||||||||||||||||||||
36 | 11 | note | TRUE | FALSE | #DIV/0! | #VALUE! | #NAME? | ||||||||||||||
37 | 11 | note | TRUE | FALSE | #DIV/0! | #VALUE! | #NAME? | ||||||||||||||
38 | 11 | note | TRUE | FALSE | #DIV/0! | #VALUE! | #NAME? | ||||||||||||||
39 | 11 | note | TRUE | FALSE | #DIV/0! | #VALUE! | #NAME? | ||||||||||||||
40 | |||||||||||||||||||||
41 | |||||||||||||||||||||
42 | 23 | book | 23 | TRUE | FALSE | #DIV/0! | #N/A | ||||||||||||||
43 | 23 | book | 23 | TRUE | FALSE | #DIV/0! | #N/A | ||||||||||||||
44 | |||||||||||||||||||||
45 | |||||||||||||||||||||
46 | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | #N/A | |||||||||||||
47 | |||||||||||||||||||||
SREPEAT |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2 | B2 | =LAMBDA(reference,[rows],[columns],LET(r,IF(reference="","",reference),a,IF(IO(rows),1,rows),b,IF(IO(columns),1,columns),IF(AND(IFERROR(ROWS(r),1)=1,IFERROR(COLUMNS(r),1)=1,ROWS(IFERROR(a,1))=1,COLUMNS(IFERROR(a,1))=1,ROWS(IFERROR(b,1))=1,COLUMNS(IFERROR(b,1))=1,ISNUMBER(a),ISNUMBER(b)),IF(SEQUENCE(INDEX(a,1),INDEX(b,1)),r,""),NA()))) |
B4 | B4 | =SREPEAT(4) |
F4:F6 | F4 | =SREPEAT(4,3) |
J4:L4 | J4 | =SREPEAT(4,,3) |
P4:R6 | P4 | =SREPEAT(4,3,3) |
B8 | B8 | =SREPEAT("book") |
F8:F10 | F8 | =SREPEAT("book",3) |
J8:L8 | J8 | =SREPEAT("book",,3) |
P8:R10 | P8 | =SREPEAT("book",3,3) |
B12 | B12 | =SREPEAT("") |
F12:F14 | F12 | =SREPEAT("",3) |
J12:L12 | J12 | =SREPEAT("",,3) |
P12:R14 | P12 | =SREPEAT("",3,3) |
B16 | B16 | =SREPEAT(TRUE) |
F16:F18 | F16 | =SREPEAT(TRUE,3) |
J16:L16 | J16 | =SREPEAT(TRUE,,3) |
P16:R18 | P16 | =SREPEAT(TRUE,3,3) |
B20 | B20 | =SREPEAT(FALSE) |
F20:F22 | F20 | =SREPEAT(FALSE,3) |
J20:L20 | J20 | =SREPEAT(FALSE,,3) |
P20:R22 | P20 | =SREPEAT(FALSE,3,3) |
B24 | B24 | =SREPEAT(#DIV/0!) |
F24:F26 | F24 | =SREPEAT(#DIV/0!,3) |
J24:L24 | J24 | =SREPEAT(#DIV/0!,,3) |
P24:R26 | P24 | =SREPEAT(#DIV/0!,3,3) |
B28 | B28 | =SREPEAT(#N/A) |
F28:F30 | F28 | =SREPEAT(#N/A,3) |
J28:L28 | J28 | =SREPEAT(#N/A,,3) |
P28:R30 | P28 | =SREPEAT(#N/A,3,3) |
E34 | E34 | =IF(1,"") |
J34 | J34 | =#DIV/0! |
B36:L39 | B36 | =SREPEAT(B34,4) |
B42:B43,D42:D43 | B42 | =SREPEAT({23},{2}) |
C42:C43 | C42 | =SREPEAT({"book"},{2}) |
E42:E43 | E42 | =SREPEAT({""},{2}) |
F42:F43 | F42 | =SREPEAT({TRUE},{2}) |
G42:G43 | G42 | =SREPEAT({FALSE},{2}) |
H42:H43 | H42 | =SREPEAT({#DIV/0!},{2}) |
I42:I43 | I42 | =SREPEAT({#N/A},{2}) |
B46 | B46 | =SREPEAT({1,2}) |
D46 | D46 | =SREPEAT({1,"book"}) |
F46 | F46 | =SREPEAT({#DIV/0!,2}) |
H46 | H46 | =SREPEAT({#DIV/0!,#N/A}) |
J46 | J46 | =SREPEAT({#DIV/0!,#DIV/0!}) |
L46 | L46 | =SREPEAT(45,{1,2}) |
N46 | N46 | =SREPEAT(45,#DIV/0!) |
P46 | P46 | =SREPEAT(45,,"") |
Dynamic array formulas. |
Upvote
0