This is my suggestion, which differs only a little bit in its concept.

In cell B1:

A formula is implemented to keep track of all cells having commas and provide entries

**=SUMPRODUCT(IF(LEN(B3:INDEX(B:B,MATCH("zz",B:B,1)))=0,0,LEN(B3:INDEX(B:B,MATCH("zz",B:B,1)))-LEN(SUBSTITUTE(B3:INDEX(B:B,MATCH("zz",B:B,1)),",",""))+1))**

In cell C1:

A formula is kept for calculating the last value filled in column B

**=MATCH("zz",B:B,1)**

So the volume formula in cell M15 suggested earlier becomes

**=SUMPRODUCT((TRIM(MID(SUBSTITUTE(","&TEXTJOIN(",",TRUE,$B$3:INDEX($B:$B,$C$1)),",",REPT(" ",99)),ROW($A$1:INDEX($A:$A,$B$1))*99,99))=$F15)*(TRIM(MID(SUBSTITUTE(","&TEXTJOIN(",",TRUE,$D$3:INDEX($D:$D,$C$1)),",",REPT(" ",99)),ROW($A$1:INDEX($A:$A,$B$1))*99,99))=M$14))**

And the value formula in cell P15 becomes

**=SUMPRODUCT((TRIM(MID(SUBSTITUTE(","&TEXTJOIN(",",TRUE,$B$3:INDEX($B:$B,$C$1)),",",REPT(" ",99)),ROW($A$1:INDEX($A:$A,$B$1))*99,99))=$F15)*(TRIM(MID(SUBSTITUTE(","&TEXTJOIN(",",TRUE,$D$3:INDEX($D:$D,$C$1)),",",REPT(" ",99)),ROW($A$1:INDEX($A:$A,$B$1))*99,99))=P$14)*MID(SUBSTITUTE(","&TEXTJOIN("",TRUE,REPT($C$3:INDEX($C:$C,$C$1)&",",LEN($B$3:INDEX($B:$B,$C$1))-LEN(SUBSTITUTE($B$3:INDEX($B:$B,$C$1),",",""))+1)),",",REPT(" ",99)),ROW($A$1:INDEX($A:$A,$B$1))*99,99))**

The intention behind this is to provide a dynamic setup which will allow you to populate columns B through D without having to edit the formulas. I am attaching the workbook.

Since you had mentioned usage of formulas, the formula implementation is shown but my suggestion would be to use a VBA based UDF as the formulas are extremely unwieldy from maintenance viewpoint. I'd leave that call to you.