It's hard to make out what you're asking. If your data looks like this:
Column A: Loan ID
Column B: Payment Date
Column C: Cash Flow Amount
If that's the case, and if you want to run an IRR for each LoanID, you would spend a lot of time trying to write a conditional XIRR formula. I wouldn't do it that way, unless you've got weeks to develop and test. Even still, it would be an error prone process.
Here's what I would do instead:
1. Add a column D, which will turn the dates in Column A to month end. It will be =EOMONTH(A1,0). The difference between the actual date and the end of the month won't meaningfully impact the IRR calculation.
2. Create a table that has loan IDs going down the page, and set of dates going out to the right that correspond with the dates in step 1.
3. In the body of the table, use a =SUMIF or =SUMIFS to aggregate the cashflows by month, by loan. (You could also do steps 1-3 with a pivot table).
4. Now you can run an XIRR of the cashflows against the dates at the top. Using =IRR is asking for trouble. I'd use =XIRR.