A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
The first two column can use formula to get. But I have no idea on the third column.
E2 is text formula
E3 formula:
=IF(LEFT(A2,2)="P-","Holdout","")
Formula in F2, Array formula need enough space to put the result, otherwise it will get spill error.
=VSTACK(TEXTSPLIT(TEXTJOIN(",",,IF(ROW(A2:A7)-1<=MATCH("P-*",A2:A7,0),A2:A7,"")),,","),"",TEXTSPLIT(TEXTJOIN(",",,IF(ROW(A2:A7)-1>MATCH("P-*",A2:A7,0),A2:A7,"")),,","))
Formula in G2 and fill down.
=IF(F2="","",IF(COUNTBLANK($F$2:F2),10%/SUM(--(ROW($A$2:$A$7)-1>MATCH("P-*",$A$2:$A$7,0))),IF(COUNTIF($A$2:$A$7,F2)>1,SUMIF($A$2:$A$7,F2,$B$2:$B$7)-10%/SUM(--(ROW($A$2:$A$7)-1>MATCH("P-*",$A$2:$A$7,0))),SUMIF($A$2:$A$7,F2,$B$2:$B$7))))
I will send the test file to you as attachment in private message.
[![](https://learn-attachment.microsoft.com/api/attachments/66ddfa6e-e8e0-4bba-9f2c-8e2875cad8fa?platform=QnA