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))
- MirohLoomeOct 02, 2024Copper Contributoryou are awsome as a high school student I love to use excel for formulas but had no idea where to start for factors. literal lifesaver!
- KennyK360Jul 08, 2023Copper ContributorHans, one more question, can we edit the formula to:
1) exclude answers less than 13
2) exclude answers with the number 1 and the number in question (e.g. 2,023 (1x2023)
3) exclude answers larger than 1,500
4) delete/exclude rows with answers not meeting the above 3 rules
Thank you again!- HansVogelaarJul 09, 2023MVP
That would be
=LET(Num,A2,All,SEQUENCE(Num-13, , 13),Factors,FILTER(All,MOD(Num,All)=0),Factors)
- KennyK360Jul 09, 2023Copper ContributorHans,
Awesome! We're getting there. Is there any edits we can make to exclude answers > 1500?
- KennyK360Jul 05, 2023Copper ContributorHans, you're an absolute genius Sir! It worked perfectly...thank you for saving me countless hours!!