YIELDMAT(settlement,maturity,issue,rate,pr,[basis]) returns the annual yield of a security that pays its interest at maturity. Rate is the interest rate from issue and pr the clean purchase price per 100 face value.
Try it
=YIELDMAT(DATE(2027,4,1),DATE(2027,7,1),DATE(2027,1,1),0.06,100,0) is about 0.0591133005. Under 30/360, interest from issue to maturity is three and accrued interest at settlement is 1.5.
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.
Microsoft documents #VALUE! for invalid dates and #NUM! for a negative interest rate, nonpositive price, invalid basis or settlement at/after maturity. The current helper additionally requires issue strictly before settlement. Accrued interest changes the invested amount; using clean price alone in the denominator is a different calculation.
The current remaining day count is the difference between its issue-to-maturity and issue-to-settlement day counts. Recomputing a fresh settlement-to-maturity 30/360 count can change calendar-boundary behaviour.
How to implement
The current recovered arithmetic keeps normalized price and interest terms separate. Use R at every named operation below.
Validate dates in the order required by the host and require issue<settlement<maturity. Admit nonnegative rate and positive price.
Compute DIM=days(issue,maturity,basis) and A=days(issue,settlement,basis) with the source’s day-count helper. Set DSM=R(DIM-A). Obtain B from days_in_year_for_mat(issue,settlement,basis), using that interval’s calendar rules.
Calculate interest=R(R(DIM/B)*rate), accrued=R(R(A/B)*rate) and price_norm=R(price/100).
Store invested=R(price_norm+accrued). Reuse this stored value in gain=R(R(1+interest)-invested).
Return R(R(gain/invested)*R(B/DSM)). The gain division and year-ratio division are separate stores before multiplication.
For the example, DIM=180,A=90,DSM=90,B=360. The reconstructed stored stages are:
Stage
Binary64 value
Interest
0.03
Accrued
0.015
Invested
1.015
Gain
0.015000000000000124
Gain / invested
0.014778325123152834
B / DSM
4
Yield
0.059113300492611334
The mathematical expression can also be written (103/101.5-1)*4, but that expression does not preserve the identified subtraction and reuse of invested. The table evaluates the reconstruction; it is not a new Excel reading. The source records a 1,250-input control, including a held-out sweep, for its stored graph. Calendar helpers, publication and environment transfer retain their own scope.
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.
No implementation has been published with a Handbook test suite for this function.
Version differences
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
Excel 16.0 build
Platform and CPU
Captured inputs
20131
Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics
1,085
The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.
Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics
1,085 captured inputs are indexed for this environment. Capture dates: 2026-07-11 to 2026-07-11. This is a reading count, not a comparison with another build.
Alternatives
PRICEMAT solves price; YIELD handles periodic coupons; YIELDDISC handles a discounted redemption without this accrued-interest model.