Try using SUMPRODUCT
:
=SUMPRODUCT(($R$2:$R$103="No")*($D$2:$D$103=D29)*($N$2:$N$103>$M$2:$M$103)*($N$2:$N$103>$P$2:$P$103))
This will count rows if:
- There is "No" in the column R;
- There are other rows with the same Sales Order (col D) with;
- Both quantity picked and quantify on hand below open quantity.
I discarded the 'or' part because from your comments, it's really not an 'or' but an 'and'.