Using your supplied data, this works

Formula: copy to clipboard
=SUM(OFFSET(A1,1,MATCH(E1,A1:C1,0)-1,100,1))