The dummy column works properly. The error you're seeing is probably to do with the references in the formula are all incorrect. You are only referencing rows 2:5 rather than the entire table and you are referencing the buy price, rather than the dummy column.

Formula: copy to clipboard
=SUM(1*(MMULT(((MIN(A2:A15)-ROW(A2)+ROW(OFFSET(A2,0,0,MAX(B2:B15)-MIN(A2:A15)+1,1)))>=TRANSPOSE(A2:A15))*((MIN(A2:A15)-ROW(A2)+ROW(OFFSET(A2,0,0,MAX(B2:B15)-MIN(A2:A15)+1,1)))<=TRANSPOSE(B2:B15)),F2:F15)<>0))