I'm trying to generate a list of all the factors of a number in MS Excel. I have the following formula:
=NOT(MOD(12,SEQUENCE(1,12)))*(SEQUENCE(1,12))
This gives me an array with factors and zeros, as below:
1 2 3 4 0 6 0 0 0 0 0 12
But I can't seem to find a formula to remove the zeros. I've tried different permutations of LET, LAMBDA, LARGE, FILTER, SORT, and others. Nothing works. Any tips on what I could be doing wrong? I want to do this without VBA.
=LET(x,NOT(MOD(12,SEQUENCE(1,12)))*(SEQUENCE(1,12)),FILTER(x,x<>0))FILTER(x,x)because any value other than 0 is considered TRUE and 0 is FALSE