TCO and the number of applications

How do you break down the costs of owning your application portfolio into a components that can be calculated?  I have a simple expression that I believe encapsulates the TCO of an architectural component (legacy application, SOBA, service provider, etc). The Total Cost of Ownership of your portfolio of applications is    For Each n in Portofolio:…

4