Absolutely, you would take all of the costs involved and factor them into the formula. The first cost would obviously be purchase price, closing costs and so forth. Next you would have a series of payments (the sum of principal, interest, taxes, insurance, maintenance and depreciation). The last cost would be selling price and associated closing costs.
We simply plug those costs into the formula and it spits out a rate of return.
It's actually a simple formula:
If I bought an item for a dollar and sold it a year later for $0.50, what is my rate of return? Negative 50% per year.
If I bought another item for a dollar and sold it the next year for two dollars, what is my rate of return? Positive 100% per year.
That's the internal rate or return. Even though there are no "dividends" or "interest" there is still a rate of return associated
See how that works?
In corporate finance, we use the formula to determine whether to expand the business and a lot of other things. So, obviously you can get far more complicated but the basic principles are the same.
For a more technical explanation of the formula:
http://hspm.sph.sc.edu/COURSES/ECON/irr/irr.html