Forum Discussion
Need help with a function/formula in Excel to determine the factors of a number
- Jul 05, 2023
Let's say your number is in A2.
If you want the factors in cells below each other:
=LET(Num, A2, All, SEQUENCE(Num), Factors, FILTER(All, MOD(Num, All)=0), Factors)
If you want the factors in cells next to each other, from left to right:
=LET(Num, A2, All, SEQUENCE(Num), Factors, FILTER(All, MOD(Num, All)=0), TRANSPOSE(Factors))
If you want the factors in a single cell, separated by commas and spaces:
=LET(Num, A2, All, SEQUENCE(Num), Factors, FILTER(All, MOD(Num, All)=0), TEXTJOIN(", ", TRUE, Factors))
Let's say your number is in A2.
If you want the factors in cells below each other:
=LET(Num, A2, All, SEQUENCE(Num), Factors, FILTER(All, MOD(Num, All)=0), Factors)
If you want the factors in cells next to each other, from left to right:
=LET(Num, A2, All, SEQUENCE(Num), Factors, FILTER(All, MOD(Num, All)=0), TRANSPOSE(Factors))
If you want the factors in a single cell, separated by commas and spaces:
=LET(Num, A2, All, SEQUENCE(Num), Factors, FILTER(All, MOD(Num, All)=0), TEXTJOIN(", ", TRUE, Factors))