The below would do what you want
Note: the MIN isn't required, and thus nor is the Array entry (prior post)
However, the above will be Volatile (c/o OFFSET) so if, in real life, your precedent ranges are either very big and/or you intend to perform a lot of calcs on filtered datasets you will be much better off adding the SUBTOTAL calc to the table, and by much I mean considerably! So, for ex.
you can then persist with standard, non-volatile, SUMIFS approach using Col L to generate the 'count' - e.g. SUMIFS(L3:L500,....)
SUMIFS is more efficient than COUNTIFS when applied to big ranges, which is why I would go that route.
Bookmarks