Financial functions
YIELDDISC
Matches all 31 recorded answers
Recorded: 31 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | YIELDDISC |
| Bulgarian | YIELDDISC |
| Czech | YIELDDISC |
| Danish | AFKAST.DISKONTO |
| German | YIELDDISC |
| Greek | YIELDDISC |
| English (Australia) | YIELDDISC |
| English (United Kingdom) | YIELDDISC |
| English (United States) | YIELDDISC |
| Spanish | RENDTO.DESC |
| Estonian | YIELDDISC |
| Finnish | TUOTTO.DISK |
| French | RENDEMENT.SIMPLE |
| Hebrew | YIELDDISC |
| Croatian | YIELDDISC |
| Hungarian | HOZAM.LESZÁM |
| Indonesian | YIELDDISC |
| Italian | YIELDDISC |
| Japanese | YIELDDISC |
| Korean | YIELDDISC |
| Lithuanian | YIELDDISC |
| Latvian | YIELDDISC |
| Norwegian | YIELDDISC |
| Dutch | REND.DISCONTO |
| Polish | RENT.DYSK |
| Portuguese (Brazil) | YIELDDISC |
| Portuguese (Portugal) | LUCRODESC |
| Romanian | YIELDDISC |
| Russian | ДОХОДСКИДКА |
| Slovak | YIELDDISC |
| Slovenian | YIELDDISC |
| Serbian (Latin) | YIELDDISC |
| Swedish | NOMAVKDISK |
| Thai | YIELDDISC |
| Turkish | ÖDEMEİND işlevi |
| Ukrainian | YIELDDISC |
| Vietnamese | YIELDDISC |
| Chinese (Simplified) | YIELDDISC |
| Chinese (Hong Kong) | YIELDDISC |
| Chinese (Traditional) | YIELDDISC |
Names from Microsoft's support site.
What it does
YIELDDISC(settlement, maturity, pr, redemption, [basis])
YIELDDISC(settlement,maturity,pr,redemption,[basis]) returns the annual investment yield of a discounted security. Both amounts are expressed per the same face-value unit.
Try it
=YIELDDISC(DATE(2027,1,1),DATE(2027,1,31),96,100,2) is about 0.5. The gain is four on a price of 96, annualized from thirty actual days using a 360-day year.
Quirks
Basis defaults to zero: 0 US 30/360, 1 actual/actual, 2 actual/360, 3 actual/365, 4 European 30/360. Dates and selectors are truncated under their documented rules. Use DATE values rather than locale-dependent date text. Price and redemption must be positive and settlement before maturity. Invalid dates give #VALUE!; invalid amounts, date order or basis give #NUM!. This is yield on purchase price, not the discount rate on redemption.
How to implement
- Truncate the dates and basis, validate the workbook dates, require positive price and redemption and settlement before maturity.
- Obtain the numerator day count
daysfor the selected basis. Bases 0 and 4 use their respective 30/360 rules; bases 1, 2 and 3 use actual serial days. - Obtain the year denominator B: 360 for bases 0, 2 and 4; 365 for basis 3; the source’s calendar-dependent
days_in_year_for_matfor basis 1. The latter can use 365, 366 or a multi-year average. Do not silently substitute a fixed 365 or call a different YEARFRAC algorithm. - Using ordinary binary64 stores D, form
gain=D(redemption-price),relative_gain=D(gain/price),year_scale=D(B/days)andyield=D(relative_gain*year_scale).
For the example the gain is four, relative gain is about 0.041666666666666664, and year scale is 360/30=12. Their product is one half. The year ratio is computed separately: ((red-price)/price)*B/days is another association with potentially different low bits.
The retained source records 25 of 25 readings distinguishing this grouped year ratio; the left-to-right candidate matched 17. Its calendar scaffolding and initial formula include a credited, changed translation of the Apache-licensed ExcelFinancialFunctions project, alongside project-owned changes guided by recorded answers. This scope does not establish every date seam or whole-function numerical agreement.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
YIELDDISC · 4 lines · calc-func/src/catalogue/bonds.rs on GitHub7 yielddisc_fn "YIELDDISC" (4, 5) [V "settlement", V "maturity", V "pr", V "redemption", V "basis"] |s, a, sv| {
let (settlement, maturity) = (date_1900(s, a, 0, sv)?, date_1900(s, a, 1, sv)?);
bond_out(s, bond::yielddisc_kernel(settlement, maturity, num(s, a, 2)?, num(s, a, 3)?, Some(or(s, a, 4, 0.0)?)))
}
yielddisc_kernel · 26 lines · calc-func/src/ported/bond_core_family.rs on GitHubpub fn yielddisc_kernel(
settlement: f64,
maturity: f64,
price: f64,
red: f64,
basis_: Option<f64>,
) -> Result<f64, BondCoreEvalError> {
let settlement = dser(settlement)?;
let maturity = dser(maturity)?;
let price = pos(price)?;
let red = pos(red)?;
let basis_ = basis(basis_.unwrap_or(0.0))?;
if settlement >= maturity {
return Err(derr(WorksheetErrorCode::Num));
}
// Faithful port of ExcelFinancialFunctions `yieldDisc` (bonds.fs):
// `(redemption - pr) / pr * b / dim`, with `dim` the numerator day-count and
// `b` DaysInYear. The prior `(red/price - 1) / yearfrac` form was algebraically
// equal but ~5 ULP off (different operation order) and used the YEARFRAC
// act/act algorithm rather than DaysBetween/DaysInYear.
let dim = dd(settlement, maturity, basis_)?;
let b = days_in_year_for_mat(settlement, maturity, basis_)?;
// Excel groups the year ratio: ((red - price)/price)*(b/dim) (dc-j9k: 25 of 25 readings in
// the catalogue oracle's sheet dcj9k_closed_form; the left-to-right form matched 17).
Ok(((red - price) / price) * (b / dim))
}
Kernels shared with other functions
orcatalogue/bondsbond_outcatalogue/bondsdate_1900catalogue/financialdays_from_civillocalecivil_from_dayslocaleexcel_serial_from_ymdlocaleymd_from_excel_seriallocalemax_serialported/bond_core_familyderrported/bond_core_familydyearported/bond_core_familydimported/bond_core_familyactported/bond_core_familybasisported/bond_core_familydserported/bond_core_familyposported/bond_core_familyd360usported/bond_core_familyd360euported/bond_core_familyless_or_equal_to_a_year_apartported/bond_core_familyconsider_as_bisestileported/bond_core_familydays_in_year_for_matported/bond_core_familyddported/bond_core_familymap_bond_core_error_to_wsported/bond_core_familydays_in_monthported/day_count_commonus_30_360ported/day_count_common
Argument and result plumbing
No implementation has been published with a Handbook test suite for this function.
Version differences
No same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.
Alternatives
DISC uses a discount-on-redemption rate; PRICEDISC solves price; TBILLYIELD applies its bill-specific convention.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents