CUMIPMT function
This article describes the formula syntax and usage of the CUMIPMTfunction in Microsoft Excel.
Description
Returns the cumulative interest paid on a loan between start_period and end_period.
Syntax
CUMIPMT(rate, nper, pv, start_period, end_period, type)
The CUMIPMT function syntax has the following arguments:

Rate Required. The interest rate.

Nper Required. The total number of payment periods.

Pv Required. The present value.

Start_period Required. The first period in the calculation. Payment periods are numbered beginning with 1.

End_period Required. The last period in the calculation.

Type Required. The timing of the payment.
Type 
Timing 
0 (zero) 
Payment at the end of the period 
1 
Payment at the beginning of the period 
Remarks

Make sure that you are consistent about the units you use for specifying rate and nper. If you make monthly payments on a fouryear loan at an annual interest rate of 10 percent, use 10%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 10% for rate and 4 for nper.

If rate ≤ 0, nper ≤ 0, or pv ≤ 0, CUMIPMT returns the #NUM! error value.

If start_period < 1, end_period < 1, or start_period > end_period, CUMIPMT returns the #NUM! error value.

If type is any number other than 0 or 1, CUMIPMT returns the #NUM! error value.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How do I copy an example?

Select the example in this article. If you are copying the example in Excel Online, copy and paste one cell at a time.
Important: Do not select the row or column headers.Selecting an example from Help

Press CTRL+C.

Create a blank workbook or worksheet.

In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Online, repeat copying and pasting for each cell in the example.
Important: For the example to work properly, you must paste it into cell A1 of the worksheet. 
To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
After you copy the example to a blank worksheet, you can adapt it to suit your needs.


Notes

The interest rate is divided by 12 to get a monthly rate. The years the money is paid out is multiplied by 12 to get the number of payments.

In Excel Online, to view the result in its proper format, select the cell, and then on the Home tab, in the Number group, click the arrow next to Number Format, and click General.