I am trying to figure out a way to use the XIRR calculation so that it will continue to work when the number of Dates/Values change. Basically, I have a set of cash flows and specific dates. This is real estate related, so it's an original purchase price, then contributions and distributions, and eventually a sale (reversion). In order to keep the model flexible, I need to be able to change the Date I sell the building (currently by using a referenced drop-down list). Due to this, the number of inputs in the range (CF's) changes depending on the year of the exit. I need all of the input years, and then the reversion year, included in the XIRR formula. Row 17 includes the specific dates I'd like to use, and Row 19 includes the values. Cell T17 has where I had been attempting the XIRR. B6 is the dropdown to choose what year to sell the asset.
I've attached the spreadsheet to make things more clear.

XIRR Help.xlsx

Please let me know if I have not clarified well enough.