Return the depreciation for each accounting period. <span align="right" style="background-color:99FF99"><strong>Excel: AMORDEGRC</strong></span>

You're viewing an older version of this page (#324). View the current version.

View versions (1)

Interface

#include <codecogs/finance/accounting/deprecproratedm.h>

using namespace Finance::Accounting;

This function calculates the depreciation of an asset for each accounting period. It is provided for use with the French accounting system. This function is equivalent to the Microsoft Excel function AMORDEGRC. Its behaviour is similar to that of AMORLINC, except that a depreciation coefficient is applied depending on the life of the asset. The coefficients are shown in the table below: <div align="center"> <table border="0"> <tr> <th align="left">Life of asset (1/rate)</th> <th align="left">Depreciation coefficient</th> </tr> <tr> <td align="center">Under 3 years</td> <td align="center">1.0</td> </tr> <tr> <td align="center">3<=Life<5</td> <td align="center">1.5</td> </tr> <tr> <td align="center">5<=Life<=6</td> <td align="center">2.0</td> </tr> <tr> <td align="center">More than 6 years</td> <td align="center">2.5</td> </tr> </table> </div>

Example 1

#include <stdio.h>

#include <codecogs/units/date/date.h>
#include <codecogs/units/date/dateymd.h>
#include <codecogs/finance/accounting/deprecproratedm.h>

int main(void)
{
  int datePur=Units::Date::date(1998, 8, 19);
  int dateFir=Units::Date::date(1998, 12, 31);
  double deprec;
  deprec=Finance::Accounting::deprecProRatedM(2400,
                                          datePur,
                                          dateFir,
                                          300,
                                          1,
                                          0.15,
                                          Finance::Banking::yb_Act);
  int y, m, d;
  
  printf("Consider an asset with the following terms:\n\n");
  printf("cost 2400, salvage 300, 1st period, rate 15%%\n");
 
  Units::Date::dateYMD(datePur, y, m, d);
  printf("purchase date %i/%i/%i, ", y, m, d);

  Units::Date::dateYMD(dateFir, y, m, d);
  printf("end of first period %i/%i/%i, ", y, m, d);
  
  printf("depreciation=%f\n", deprec);
  return 0;
}

Output:

Consider an asset with the following terms:

cost 2400, salvage 300, 1st period, rate 15%
purchase date 1998/8/19, end of first period 1998/12/31, depreciation=776.000000

Parameters

valCost
The cost of the asset.
datePu
The date of purchase of the asset.
dateFi
The date of the end of the first period.
valSalv
The salvage value at the end of the life of the asset.
per
The period.
rate
The rate of depreciation (e.g. 15% depreciation rate is
Blank

0.15).

Parameters

basis
The day count basis to use:
Blank

\copydoc YearBasis

Returns

The depreciation for each accounting period.
GPL Licence — free for non commercial use. See Licence details.