Hi

Welcome to board.

Use either of this

=SUMPRODUCT(--(K5:K36>=O4),--(K5:K36<=O5),L5:L36+M5:M36)

=SUM(IF(K5:K36>=O4,IF(K5:K15<=O5,L5:M36)))

The second one is an array formula.