There are some problems of your data setup. Here is how the IRR works (http://www.investopedia.com/ask/answers/022615/what-formula-calculating-internal-rate-return-irr-excel.asp). Without your data, here is how you can make this to work for matching different investments.
See the attached image below and assume you are entering the formula from cell F2
and here you go:
=XIRR(OFFSET($C$1,MATCH(E2,$A$2:$A$17,0),0,COUNTIF($A$2:$A$17,E2)),OFFSET($B$1,MATCH(E2,$A$2:$A$17,0),0,COUNTIF($A$2:$A$17,E2)))
Please note this is an array formula (need to click Ctrl + Shift + Enter together)).

What I did is to use OFFSET
to find the pertaining ranges for dates and values of each investment. And here I have also showed you the results for a valid data inputs. Try and let me know.