lrobbo314
Well-known Member
- Joined
- Jul 14, 2008
- Messages
- 3,963
- Office Version
- 365
- Platform
- Windows
FACTORS will return all the factors for a given number.
Excel Formula:
=LAMBDA(
number,[transpose],
LET(
n,number,
s,SEQUENCE(INT(SQRT(n))),
t,MOD(n,s)=0,
r,INT(BASE(t*(n/s),10)),
fx,LAMBDA(x,FILTER(x,t)),
f,UNIQUE(SORT(VSTACK(fx(s),fx(r)))),
IF(transpose,
TRANSPOSE(f),
f
)
)
)
FACTORS | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Number | Factor | ||||||||||
2 | 1 | 1 | ||||||||||
3 | 2 | 1 | 2 | |||||||||
4 | 3 | 1 | 3 | |||||||||
5 | 4 | 1 | 2 | 4 | ||||||||
6 | 5 | 1 | 5 | |||||||||
7 | 6 | 1 | 2 | 3 | 6 | |||||||
8 | 7 | 1 | 7 | |||||||||
9 | 8 | 1 | 2 | 4 | 8 | |||||||
10 | 9 | 1 | 3 | 9 | ||||||||
11 | 10 | 1 | 2 | 5 | 10 | |||||||
12 | 11 | 1 | 11 | |||||||||
13 | 12 | 1 | 2 | 3 | 4 | 6 | 12 | |||||
14 | 13 | 1 | 13 | |||||||||
15 | 14 | 1 | 2 | 7 | 14 | |||||||
16 | 15 | 1 | 3 | 5 | 15 | |||||||
17 | 16 | 1 | 2 | 4 | 8 | 16 | ||||||
18 | 17 | 1 | 17 | |||||||||
19 | 18 | 1 | 2 | 3 | 6 | 9 | 18 | |||||
20 | 19 | 1 | 19 | |||||||||
21 | 20 | 1 | 2 | 4 | 5 | 10 | 20 | |||||
22 | 21 | 1 | 3 | 7 | 21 | |||||||
23 | 22 | 1 | 2 | 11 | 22 | |||||||
24 | 23 | 1 | 23 | |||||||||
25 | 24 | 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24 | |||
26 | 25 | 1 | 5 | 25 | ||||||||
27 | 26 | 1 | 2 | 13 | 26 | |||||||
28 | 27 | 1 | 3 | 9 | 27 | |||||||
29 | 28 | 1 | 2 | 4 | 7 | 14 | 28 | |||||
30 | 29 | 1 | 29 | |||||||||
31 | 30 | 1 | 2 | 3 | 5 | 6 | 10 | 15 | 30 | |||
32 | 31 | 1 | 31 | |||||||||
33 | 32 | 1 | 2 | 4 | 8 | 16 | 32 | |||||
34 | 33 | 1 | 3 | 11 | 33 | |||||||
35 | 34 | 1 | 2 | 17 | 34 | |||||||
36 | 35 | 1 | 5 | 7 | 35 | |||||||
37 | 36 | 1 | 2 | 3 | 4 | 6 | 9 | 12 | 18 | 36 | ||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2:A101 | A2 | =SEQUENCE(100) |
B2,B37:J37,B34:E36,B33:G33,B32:C32,B31:I31,B30:C30,B29:G29,B27:E28,B26:D26,B25:I25,B24:C24,B22:E23,B21:G21,B20:C20,B19:G19,B18:C18,B17:F17,B15:E16,B14:C14,B13:G13,B12:C12,B11:E11,B10:D10,B9:E9,B8:C8,B7:E7,B6:C6,B5:D5,B3:C4 | B2 | =FACTORS(A2,1) |
Dynamic array formulas. |
Upvote
0