enter image description here
I have typed it in excel function like below,
IFS(B2="discount",0,H2=0,(SUMIFS(H:H,A:A,A2,B:B,"discount&quo