# How do I simplify this formula to be expandable?

The Example sheet

The formula:

``````For all x from 1 to 10, if (Sell <= Buy * x) then x, else ">=10"
``````

I thought I might be able to cheat a little with the sequence function:

`=ARRAYFORMULA(MIN(IF(Sell range <= SEQUENCE(4,1,1) * Buy, SEQUENCE(4,1,1))))`

But since the sell range is in the min function, I only get the first result.

Is there a good way to make this formula expandable? It's not necessary, I'm just really curious.

• Is your goal to come up with an efficient/concise formula, or is it to learn (i.e., how to apply MIN with SEQUENCE)? May 22 at 16:27
• @ErikTyler Both actually. It just bothered me that I didn't know of a way to take better advantage of functions and was relying heavily on IF. May 23 at 7:45
• There are ways to get the minimum applicable result from a sequence (or set of columns) with array formulas. But they are more complex a solution than your current case demands. If you're interested in seeing some for study purposes, let me know, and I'll share a few. May 23 at 18:59

``````=ARRAYFORMULA(IF(ISBLANK(B2:B),"",IF(B2:B >= \$A\$2,CEILING(B2:B/A2),1)))