OK, this is due to my non familiarity with xirr...
You would need the IF in BOTH arguments of the xirr function...
so say the xirr formula is
=xirr(a1:a100,b1:b100)
and your criteria is column C = X
=XIRR(IF(C1:C100="X",A1:A100),IF(C1:C100="X",B1:B100))
I think that will work...