Hi

You mean like this

=SUM(P5:INDEX(P5:P720,MATCH(G26,L5:L720)))