Based on the narrative in post #9 it seems that the following modification of Ali's formula is what you want:Formula:
=IF(B3="","",IF(AND(COUNTIFS(C$3:C3,C3,E$3:E3,E3)>1,COUNTIFS(A$3:A3,A3,F$3:F3,F3)=1),F3-G3,IF(COUNTIFS($C$3:$C3,C3,$D$3:$D3,D3,$E$3:E3,E3)=1,E3+F3-G3,G3)))
Let us know if you have any questions.
Bookmarks