this version also seems ok with "guess" based off net value,
=XIRR(IFERROR(INDEX(F5:G246,AGGREGATE(15,1,C5:C246,IF(1,+C5:C246)),N(IF(1,{1,2}))),),IFERROR(INDEX(D5:E246,AGGREGATE(15,1,C5:C246,IF(1,+C5:C246)),N(IF(1,{1,2}))),),IF(SUBTOTAL(9,F5:G246)>0,0.1,-0.1))