This is the first page on the financial category of ECMA-376 5th edition Part 1 (December 2016) section 18.17.7. It covers the 21 functions from ACCRINT (18.17.7.2) to FVSCHEDULE (18.17.7.130) in alphabetical order. The category lists 53 functions in all; the other 32 follow on the next page. For each function the page gives what it takes and returns, the standard’s example, what [MS-OI29500] v20260818 says Office does differently where it has a note, and what LibreOffice returns. Section numbers are the standard’s own.
How the examples were checked
The standard’s examples and the edge cases were written as 171 formulas in
samples/xlsx/oracle/finfn1/formulas.txt, built into a real XLSX with
samples/xlsx/oracle/make-xlsx.mjs (formula cells without cached values) and converted to CSV by
LibreOffice (soffice --headless --convert-to csv). LibreOffice is an implementation, not the
standard: where it differs the difference is reported, not corrected. Its errors appear in its own spellings:
Err:502 (invalid argument, the standard’s #NUM! in most cases) and Err:504 (error
in the parameter list). Dates are serial numbers: COUPNCD and COUPPCD return numbers, and 39217 is 15 May
2007. The standard prints most results rounded to the digits shown; LibreOffice’s are its full
precision.
Day counts. The standard describes five bases (0 or omitted 30/360 US, 1 actual/actual, 2 actual/360, 3 actual/365, 4 European 30/360) and says a basis below 0 or above 4 gives #NUM!. [MS-OI29500] adds the exact adjustments for each basis in the notes for every function that has a basis argument. In these tests LibreOffice returned Err:502 for basis 5 in ACCRINT, ACCRINTM and COUPDAYBS, the three where it was tried.
The 21 functions
Argument names are the standard’s. Optional arguments are in brackets. Dates in the examples are written with DATE(year, month, day).
| Function | Arguments and result | Standard’s example | LibreOffice |
|---|---|---|---|
ACCRINT (.2) | issue, first-interest, settlement, rate, [par], frequency [, basis]: the accrued interest of a security that pays periodic interest. par is 1,000 if omitted. #NUM! if a date is out of range, issue ≥ settlement, rate or par ≤ 0, frequency is not 1, 2 or 4 (truncated first), or basis is below 0 or above 4. MS-OI29500 2.1.874: Office has an eighth argument calc-method (TRUE from issue, FALSE from first-interest) that the standard lacks, and uses 0.001 as the default par, not 1,000 | ACCRINT(DATE(2006,3,1),DATE(2006,9,1),DATE(2006,5,1),0.1,1100,2,0) = 18.33; with par omitted = 16.67 | 18.3333333333333 and 16.6666666666667 (par 1,000 as the standard says, not the note’s 0.001); basis omitted 18.33, 1 gives 18.3836, 2 18.6389, 3 18.3836, 4 18.3333; frequency 4 and 2.9 give 18.3333 (2.9 is truncated); frequency 3, issue after settlement, rate 0, par 0 and basis 5 Err:502; settlement after first-interest 73.3333; with the eighth argument FALSE Err:504 (calc-method is not accepted) |
ACCRINTM (.3) | issue, settlement, rate [, [par] [, basis]]: the accrued interest of a security that pays interest at maturity, par × rate × A/D. par is 1,000 if omitted. #NUM! if a date is out of range, issue ≥ settlement, rate or par ≤ 0, or basis is out of 0 to 4. MS-OI29500 2.1.875: Office uses 0.001 as the default par and counts A from issue to settlement (the standard says to maturity) | ACCRINTM(DATE(2006,3,1),DATE(2006,5,1),0.1,1100,0) = 18.33333333; with par omitted = 16.66666667; (…,0.1,) = 16.66666667 | 18.3333333333333, 16.6666666666667 and 16.6666666666667; basis 1 and 3 18.3835616438356; issue after settlement, rate 0, par 0 and basis 5 Err:502 |
AMORDEGRC (.7) | cost, date-purchased, first-period, salvage, period, rate [, basis]: the depreciation of a period under the French system, with a coefficient of 1.5 for a life of 3 to 4 years, 2 for 5 to 6 years and 2.5 for more than 6; the rate grows to 50 percent for the period before the last and to 100 percent for the last. #NUM! if cost, salvage, period or rate < 0, a date is out of range, basis is out of 0 to 4, or the life (1/rate) is between 0 and 1, 1 and 2, 2 and 3 or 4 and 5. MS-OI29500 2.1.878 b: Office does not use basis 2. The standard says it is similar to AMORLINC “(§18.17.7.7)”, which is its own section, AMORLINC is 18.17.7.8 | AMORDEGRC(2400,DATE(2008,8,19),DATE(2008,12,31),300,1,0.15,1) = 776.00 | 776; basis omitted 776; basis 2 774 (accepted); cost −2400 Err:502; period 0 gives 330; for periods 2 to 7 485, 303, 190, 158, 0, 0 with rate 0.15; rate 0.22 (life 4.5) gives 696 and rate 0.4 (life 2.5) 820, where the standard says #NUM! |
AMORLINC (.8) | the same arguments: the linear depreciation of a period, with the prorated first period. #NUM! conditions as AMORDEGRC without the life rule. MS-OI29500 2.1.879 repeats the basis table | AMORLINC(2400,DATE(2008,8,19),DATE(2008,12,31),300,1,0.15,1) = 360.00 | 360; basis omitted and 2 give 360; periods 2 to 5 give 360, 6 gives 168.196721311475, 7 gives 0 |
COUPDAYBS (.57) | settlement, maturity, frequency [, basis]: the days from the start of the coupon period to settlement. #NUM! if a date is out of range, settlement ≥ maturity, frequency is not 1, 2 or 4, or basis is out of 0 to 4. Time in the dates is ignored | COUPDAYBS(DATE(2007,1,25),DATE(2008,11,15),2,1) = 71; with basis omitted 70 | 71 and 70; frequency 1 basis 0 70; frequency 4 basis 3 71; basis 2 71; basis 4 70; frequency 3, settlement after maturity and basis 5 Err:502; a settlement with a time part (25 January 18:00) gives 71, the time is ignored |
COUPDAYS (.58) | the same arguments: the days in the coupon period that contains settlement. Same #NUM! rules | COUPDAYS(DATE(2007,1,25),DATE(2008,11,15),2,1) = 181; basis omitted 180 | 181 and 180; frequency 1 basis 1 365; frequency 4 basis 3 91.25 (365/4); basis 2 and 4 180 |
COUPDAYSNC (.59) | the same arguments: the days from settlement to the next coupon date. Same #NUM! rules | COUPDAYSNC(DATE(2007,1,25),DATE(2008,11,15),2,1) = 110; basis omitted 110 | 110 for basis 1, omitted, 2, 3 and 4 |
COUPNCD (.60) | the same arguments: the next coupon date after settlement, as a date. Same #NUM! rules | COUPNCD(DATE(2007,1,25),DATE(2008,11,15),2,1) = 15-May-2007 | 39217 (15 May 2007); basis omitted the same; frequency 1 39401 (15 November 2007); frequency 4 39128 (15 February 2007); a settlement of 15 May 2007 gives 39401, the next one after it |
COUPNUM (.61) | the same arguments: the number of coupons payable between settlement and maturity, rounded up. Same #NUM! rules. MS-OI29500 2.1.911: Office truncates both dates, and returns #NUM! when the months between them are not a multiple of the coupon spacing and settlement is less than one period from serial day 1 | COUPNUM(DATE(2007,1,25),DATE(2008,11,15),2,1) = 4 | 4; frequency 1 gives 2, frequency 4 gives 8; a settlement of 15 May 2007 gives 3. The note’s #NUM! case was not tested |
COUPPCD (.62) | the same arguments: the previous coupon date before settlement, as a date. Same #NUM! rules | COUPPCD(DATE(2007,1,25),DATE(2008,11,15),2,1) = 15-Nov-2006 | 39036 (15 November 2006); frequency 1 and 4 also 39036; a settlement of 15 May 2007 gives 39217, that day itself |
CUMIPMT (.72) | rate, nper, pv, start-period, end-period, type: the interest paid on a loan between two periods (numbered from 1); type 0 pays at the end of the period and 1 at the beginning. #NUM! if rate, nper or pv ≤ 0, a period is below 1, start-period > end-period, or type is not 0 or 1. MS-OI29500 2.1.917: Office returns #NUM! when end-period is above nper and truncates both periods | CUMIPMT(0.09/12,30*12,125000,13,24,0) = −11135.23; (…,1,1,0) = −937.50 | −11135.2321307508 and −937.5; type 1 −11052.3395838718; end-period above nper, rate 0, start above end, type 2, start-period 0 and pv 0 Err:502; periods 13.9 and 24.9 give the same as 13 and 24 (truncated) |
CUMPRINC (.73) | the same arguments: the principal paid between two periods. Same #NUM! rules; MS-OI29500 2.1.918 as for CUMIPMT | CUMPRINC(0.09/12,30*12,125000,13,24,0) = −934.11; (…,1,1,0) = −68.28 | −934.107123420899 and −68.2782711809784; type 1 −927.153472378064; end-period above nper and rate 0 Err:502 |
DB (.80) | cost, salvage, life, period [, month]: fixed-declining balance with the rate 1 − (salvage/cost)1/life rounded to three decimals; the first period is cost × rate × month/12 and the last (12 − month)/12 of the rest; month is 12 if omitted. #NUM! if cost, salvage, life or period < 0 or month is outside 1 to 12. MS-OI29500 2.1.924: Office returns #NUM! when period > life with month omitted or 12, or period > life + 1 | DB(1000000,100000,6,1,7) = 186,083.33; periods 2 to 7: 259,639.42, 176,814.44, 120,410.64, 81,999.64, 55,841.76, 15,845.10 | 186083.333333333, 259639.416666667, 176814.44275, 120410.63551275, 81999.6427841828, 55841.7567360285, 15845.0984738481 (all seven match); month omitted, period 1 gives 319000; period 8 with month 7, month 13, month 0 and cost −1000000 Err:502; DB(1000000,100000,6,7) (period above life, month omitted) gives 0, where the note says #NUM! |
DDB (.83) | cost, salvage, life, period [, factor]: the smaller of (cost − earlier depreciation) × factor/life and cost − salvage − earlier depreciation; factor is 2 if omitted. #NUM! if salvage < 0, life ≤ 0, period ≤ 0 or factor ≤ 0 (the standard also lists “cost life ≤ 0”, a typing slip). MS-OI29500 2.1.927: Office returns #NUM! if cost < 0 and if period > life. The standard points to VDB as 18.17.7.341, its heading is 18.17.7.342 | DDB(2400,300,10*365,1) = 1.32; DDB(2400,300,10*12,1,2) = 40.00; DDB(2400,300,10,1,2) = 480.00; DDB(2400,300,10,2,1.5) = 306.00; DDB(2400,300,10,10) = 22.12 | 1.31506849315065, 40, 480, 306, 22.1225472000002 (the standard rounds); factor 0, period above life (11), salvage −300, life 0, cost −2400 and salvage above cost Err:502 |
DISC (.91) | settlement, maturity, pr, redemption [, basis]: the discount rate, (redemption − pr)/redemption × B/DSM. #NUM! if a date is out of range, settlement ≥ maturity, pr or redemption ≤ 0, or basis is out of 0 to 4. pr and redemption are per 100 currency units. MS-OI29500 2.1.933 d: the standard’s formula has par in the denominator, Office has redemption. The category table lists DISC as 18.17.7.90, its heading is 18.17.7.91 | DISC(DATE(2007,1,25),DATE(2007,6,15),97.975,100,1) = 5.2420% | 0.0524202127659577; basis omitted 0.0520714285714288, 2 gives 0.0517021276595747, 3 gives 0.0524202127659577, 4 gives 0.0520714285714288; pr 0, redemption 0 and settlement after maturity Err:502. With the standard’s denominator (pr) the same data would give 0.0535036619198342, so LibreOffice follows the note and divides by redemption |
DOLLARDE (.95) | fractional-dollar, fraction: m.n becomes m + n/fraction, with n read in as many digits as fraction has. #NUM! if fraction < 0, #DIV/0! if it is 0. MS-OI29500 2.1.937 gives the same rule in words | DOLLARDE(1.02,16) = 1.125; DOLLARDE(1.1,32) = 1.3125 | 1.125 and 1.3125; fraction 16.9 gives 1.125 (truncated); fraction 0 and −1 Err:502 (the standard says #DIV/0! for 0); −1.02 with 16 gives −1.125; DOLLARDE(1.1,100) 1.1; DOLLARDE(1.5,3) 2.66666666666667 |
DOLLARFR (.96) | decimal-dollar, fraction: the reverse; the fraction part is written with as many digits as fraction has; if no exact numerator exists, the lowest numerator times a power of ten is used. #NUM! if fraction < 0, #DIV/0! if 0. MS-OI29500 2.1.938 repeats the rule | DOLLARFR(1.125,16) = 1.02; DOLLARFR(1.125,32) = 1.04; the text says DOLLARFR(1.5,3) returns 1.15 | 1.02, 1.04 and 1.15; fraction 0 and −1 Err:502; −1.125 with 16 gives −1.02 |
DURATION (.101) | settlement, maturity, coupon, yld, frequency [, basis]: the Macaulay duration for a par value of 100. #NUM! if a date is out of range, settlement ≥ maturity, coupon or yld < 0, frequency is not 1, 2 or 4, or basis is out of 0 to 4. MS-OI29500 2.1.943: Office defines duration as the weighted average term to maturity of the cash flows (the standard says weighted average of present value) | DURATION(DATE(2008,1,1),DATE(2016,1,1),0.08,0.09,2,1) = 5.993774956 | 5.99195013802694 with basis 1, which does not match the standard’s digits; basis omitted gives 5.99377495554519, which does. Frequency 1 gives 6.147243069255 and 4 gives 5.91282819167888 (basis 1); coupon 0 gives 7.99817518248175 and yld 0 gives 6.53476054833541; coupon −0.08 and frequency 3 Err:502 |
EFFECT (.106) | nominal-rate, npery: (1 + nominal-rate/npery)npery − 1; npery is truncated. #NUM! if nominal-rate ≤ 0 or npery < 1. No MS-OI29500 note | EFFECT(0.0525,4) = 5.3543% | 5.35426673707582%; npery 4.9 the same (truncated); npery 1 gives 5.25%; npery 0 and 0.5 Err:502; nominal-rate 0 gives 0%, where the standard says #NUM! |
FV (.129) | rate, nper, pmt [, [pv] [, type]]: the future value of an investment with constant payments and a constant rate; cash paid is negative. nper is truncated to an integer, type 0 pays at the end and 1 at the beginning; #NUM! for any other type. pmt or pv shall be given. MS-OI29500 2.1.956: Office does not truncate nper or type, treats any non-zero type as 1, and allows both pmt and pv to be omitted (the result is 0) | FV(0.06/12,10,-200,-500,1) = 2,581.40; FV(0.12/12,12,-1000) = 12,682.50; FV(0.11/12,35,-2000,,1) = 82,846.25; FV(0.06/12,12,-100,-1000,1) = 2,301.40 | 2581.40337406014, 12682.503013197, 82846.2463719006, 2301.40183034091; type 2 and 0.5 both give 12809.3280433289 (any non-zero is 1, as the note says, not #NUM!); nper 12.5 gives 13244.513995921 (not truncated, as the note says); FV(0.01,10,) 0; rate 0 gives 12000 |
FVSCHEDULE (.130) | principal, schedule: principal multiplied by (1 + rate) for each rate of the schedule. Blank cells count as 0; any other non-number gives #VALUE!. No MS-OI29500 note | FVSCHEDULE(1,{0.09,0.11,0.1}) = 1.33089 | 1.33089 also for A1:C1 and for A1:F1 with three blank cells; a scalar 0.09 gives 1.09; a range holding a text cell (C1:G1: 0.1, three blanks, “x”) gives 1.1, so the text is ignored where the standard says #VALUE! |
Divergence from the standard
- Error values. Where the standard says #NUM! LibreOffice returns
Err:502, and for DOLLARDE and DOLLARFR with a fraction of 0 it returns Err:502 where the standard says #DIV/0!. A file stores the error of the program that saved it. - Where the standard says #NUM! LibreOffice returns a value. AMORDEGRC with a life of 4.5 or 2.5 years (696 and 820), EFFECT with a nominal rate of 0 (0%), FV with a type other than 0 or 1 (treated as 1), FVSCHEDULE with a text cell in the range (ignored), DB with period above life and month omitted (0, Office #NUM!).
- DURATION with basis 1. The standard’s printed 5.993774956 is what LibreOffice returns with the basis omitted; with basis 1 it returns 5.99195013802694.
- ACCRINT. Office has an eighth argument calc-method and a default par of 0.001; LibreOffice uses par 1,000 as the standard says and rejects the eighth argument with Err:504 in these tests. The same default-par note applies to ACCRINTM.
- DISC. The standard’s formula has par (pr) in the denominator; Office and LibreOffice divide by redemption.
- AMORDEGRC basis 2. Office does not use it (2.1.878 b); LibreOffice accepts it and returns 774.
- FV. Office does not truncate nper or type; LibreOffice behaves like Office, not like the standard.
- Standard text slips. The category table lists DISC as 18.17.7.90 (its heading is .91), AMORDEGRC points to AMORLINC as .7 (it is .8), DDB points to VDB as .341 (it is .342) and lists “cost life ≤ 0”, and the ACCRINT formula text and the basis tables vary between functions (the first-date adjustments of basis 0 are worded differently for ACCRINT and ACCRINTM).
What the viewer does
The viewer shows the value a cell stores and never recalculates a worksheet. The conditional-format
calculator (explorer/formats/xlsx/cf.js) implements none of the 21 functions on this page; a rule
that uses one is reported as not calculated, not guessed.
See also
- Functions: statistical (PEARSON to ZTEST): the last statistical page
- Formulas: references, ranges, array formulas, error values
- Functions: date and time: DATE, the serial numbers behind the dates here
Not described on this page
- Excel’s own results: Excel was not run, so the right-hand column is LibreOffice. The [MS-OI29500] notes 2.1.874 to 2.1.956 that name these functions were read (19 of the 21; EFFECT and FVSCHEDULE have none).
- The basis adjustments of the notes were not tested date by date, only through the standard’s examples and a few alternate bases; the COUPNUM #NUM! case of note 2.1.911 c was not tested.
- The 32 financial functions from INTRATE to YIELDMAT are on the next page.
Sources
- ECMA-376 5th edition Part 1, research/ooxml/ecma376/p1/part1.txt: category table (lines 76998 to 77015), ACCRINT (77118), ACCRINTM (77216), AMORDEGRC (77412), AMORLINC (77529), COUPDAYBS (79403), COUPDAYS (79512), COUPDAYSNC (79622), COUPNCD (79728), COUPNUM (79836), COUPPCD (79944), CUMIPMT (80433), CUMPRINC (80466), DB (80805), DDB (80904), DISC (81135), DOLLARDE (81336), DOLLARFR (81362), DURATION (81468), EFFECT (81674), FV (82280), FVSCHEDULE (82318)
- [MS-OI29500] v20260818, research/ooxml/ms/MS-OI29500.txt, notes 2.1.874 (line 17814) to 2.1.956 (line 18997)
- LibreOffice, soffice headless, XLSX to CSV: samples/xlsx/oracle/finfn1/