That depends on the type and specification of the loan. It might also
depend on the jurisdiction of the loan. For example, the computation
for Canadian mortgages can be very different.
For a typical US loan with monthly payments and no balloon payment, the
CUMIPMT() function might give you what you want. See Help > Excel Help
for detail