FACTORS

FACTORS(number,[transpose])
number
a whole number
transpose
Optional. 0 outputs to rows, 1 outputs to columns

FACTORS will return all the factors for a given number

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
3,927
Office Version
  1. 365
Platform
  1. 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
ABCDEFGHIJ
1NumberFactor
211
3212
4313
54124
6515
761236
8717
981248
109139
111012510
1211111
13121234612
1413113
151412714
161513515
1716124816
1817117
19181236918
2019119
212012451020
222113721
2322121122
2423123
25241234681224
26251525
2726121326
282713927
292812471428
3029129
313012356101530
3231131
333212481632
3433131133
3534121734
363515735
3736123469121836
Sheet2
Cell Formulas
RangeFormula
A2:A101A2=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:C4B2=FACTORS(A2,1)
Dynamic array formulas.
 
Upvote 0
It can be tried like this

=FILTER(SEQUENCE(,A2),MOD(A2,SEQUENCE(,A2))=0)
 

Forum statistics

Threads
1,215,472
Messages
6,125,005
Members
449,203
Latest member
Daymo66

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