How to use the YIELD function
What is the YIELD function?
The YIELD function calculates the yield for a security that pays interest. The YIELD function is designed to calculate the bond yield.
Table of Contents
1. Introduction
What is yield for a security that pays interest?
Yield is the annual return earned on a security like a bond that makes periodic interest payments, calculated based on the security's annual coupon payments and current market price relative to face value.
What is bond yield?
Bond yield is the overall interest rate paid by a bond issuer that combines the bond's fixed coupon rate and the market-driven capital gains or losses based on whether the bond sells above or below par value prior to maturity.
How is the YIELD function calculated?
The YIELD is calculated through a hundred iterations if there is more than one coupon period until redemption. The resolution uses the Newton method based on the formula used for the PRICE function. The yield is changed until the estimated price given the yield is close to price.
The math formula behind the PRICE function if N>1 is :
PRICE = (redemption / ((1 + (yld / frequency))^(N - 1 + (DSC/E)) + (Σ(k=1 to N) (100 x (rate / frequency)) / ((1 + (yld / frequency))^(k - 1 + (DSC/E) - (100 x (rate / frequency) x A/E)
- redemption is the redemption value per $100 face value
- yld is the yield per period
- frequency is the number of payment periods per year
- N is the number of periods
- DSC = number of days from settlement to next coupon date.
- rate is the interest rate per period
- k is the summation counter
- A = number of days from beginning of coupon period to settlement date.
- E = number of days in coupon period in which the settlement date falls
The YIELD is calculated as follows if there is one coupon period or less until redemption:
YIELD = ((redemption / 100) + (rate / frequency)) - ((par / 100) + ((A / E) × (rate / frequency))) / (par / 100) + ((A / E) × (rate / frequency)) × (frequency × E / DSR)
redemption is the redemption value of the security per $100 face value
rate is the annual coupon rate
frequency is the number of coupon payments per year
par is the price of the security per $100 face value
A is the number of days from the settlement date to the next coupon date
E is the number of days in the coupon period
DSR is the day count convention used
2. Syntax
YIELD(settlement, maturity, rate, pr, redemption, frequency, [basis])
settlement | Required. The security's settlement date which is the date after the issue date. |
maturity | Required. The date when the security expires. |
rate | Required. The security's annual coupon rate. |
pr | Required. The security's price per $100 face value (par amount). |
redemption | Required. The security's redemption value per $100 face value. |
frequency | Required. The number of coupon payments per year. Annual payments, frequency = 1; semiannual, frequency = 2; quarterly, frequency = 4. |
[basis] | Required. The Treasury bill's price per $100 face value (par amount). |
Basis | Day count |
0 (default) | US (NASD) 30/360 |
1 | Actual/actual |
2 | Actual/360 |
3 | Actual/365 |
4 | European 30/360 |
What is bond maturity?
Bond maturity is the date when a bond's term ends, at which point the issuer must repay the bond's par value and any final interest due to bondholders. A 30-year bond issued today will have a maturity date 30 years from now.
What is the bond's settlement date?
A bond's settlement date is the date when the trade is finalized and the bond is delivered to the buyer in exchange for payment to the seller. Settlement for US treasury bonds is usually T+1 day.
What is the security's annual coupon rate?
The annual coupon rate is the fixed annual interest rate the security pays based on the face value, stated at the time of issue, such as a 5% coupon paid yearly on a $1,000 bond resulting in $50 of interest annually.
What is the security's redemption value per $100 face value?
The redemption value per $100 face value is the amount the issuer must repay the investor per each $100 of the initial principal when the bond matures, typically $100.
What is the number of coupon payments per year?
The number of coupon payments per year is how many times annually the bond issuer pays interest to the bondholder, with typical frequencies being annual, semiannual, and quarterly payments.
3. Example 1
You have invested in a bond that pays an annual coupon rate of 6%, has a face value of $1,000, and matures in 5 years. The current market price of the bond is $950. What is the yield of this bond?
Here are the arguments:
- settlement: 9/30/2024 The settlement date of the security
- maturity: 9/30/2029 The maturity date of the security
- rate: The annual coupon rate (6%)
- pr: 95 The price of the security per $100 face value (($950/$1,000)*100 = 95)
- redemption: 100 The redemption value per $100 face value (100)
- frequency: 1 The number of coupon payments per year (1 for annual)
- [basis]: 0 (zero) The day count convention (optional, defaults to 0)
Here is how I calculate the pr argument in cell C5:
Formula in cell C10:
The formula in cell C6 returns 7.23% which represents the yield of this bond.
4. Example 2
You are considering investing in two bonds. Bond A pays a quarterly coupon rate of 5%, has a face value of $5,000, matures in 3 years, and is currently trading at $4,800. Bond B pays a semi-annual coupon rate of 6%, has a face value of $10,000, matures in 4 years, and is currently trading at $9,500. Which bond has a higher yield?
Here are the arguments:
For Bond A:
- settlement : 1/1/2024
- maturity : 1/1/2028
- rate : 0.05 (5%)
- pr : ($4,800/$5,000)*100
- redemption : 100
- frequency : 4 (4 for quarterly)
- [basis] : 0 (zero)
For Bond B:
- settlement : 9/30/2024
- maturity : 9/30/2028
- rate : 0.06 (6%)
- pr : ($9,500/$10,000)*100
- redemption : 100
- frequency : 2 (2 for semi-annual)
- [basis] : 0 (zero)
Bond A calculation, formula in cell C11:
Bond B calculation, formula in cell F11:
Keep in mind to use the DATE function if you enter dates in the function instead of using cell references. For example,
Date arguments are truncated to integers.
5. Why is the function not working?
The YIELD function returns:
- #VALUE! error if settlement or maturity is not a valid data type.
- #NUM! error if
- pr <= 0 (zero)
- redemption <= 0
- frequency <> 1, 2 or 4
- basis < 0 (zero)
- settlement >= maturity
5.1 Troubleshooting the error value
When you encounter an error value in a cell a warning symbol appears, displayed in the image above. Press with mouse on it to see a pop-up menu that lets you get more information about the error.
- The first line describes the error if you press with left mouse button on it.
- The second line opens a pane that explains the error in greater detail.
- The third line takes you to the "Evaluate Formula" tool, a dialog box appears allowing you to examine the formula in greater detail.
- This line lets you ignore the error value meaning the warning icon disappears, however, the error is still in the cell.
- The fifth line lets you edit the formula in the Formula bar.
- The sixth line opens the Excel settings so you can adjust the Error Checking Options.
Here are a few of the most common Excel errors you may encounter.
#NULL error - This error occurs most often if you by mistake use a space character in a formula where it shouldn't be. Excel interprets a space character as an intersection operator. If the ranges don't intersect an #NULL error is returned. The #NULL! error occurs when a formula attempts to calculate the intersection of two ranges that do not actually intersect. This can happen when the wrong range operator is used in the formula, or when the intersection operator (represented by a space character) is used between two ranges that do not overlap. To fix this error double check that the ranges referenced in the formula that use the intersection operator actually have cells in common.
#SPILL error - The #SPILL! error occurs only in version Excel 365 and is caused by a dynamic array being to large, meaning there are cells below and/or to the right that are not empty. This prevents the dynamic array formula expanding into new empty cells.
#DIV/0 error - This error happens if you try to divide a number by 0 (zero) or a value that equates to zero which is not possible mathematically.
#VALUE error - The #VALUE error occurs when a formula has a value that is of the wrong data type. Such as text where a number is expected or when dates are evaluated as text.
#REF error - The #REF error happens when a cell reference is invalid. This can happen if a cell is deleted that is referenced by a formula.
#NAME error - The #NAME error happens if you misspelled a function or a named range.
#NUM error - The #NUM error shows up when you try to use invalid numeric values in formulas, like square root of a negative number.
#N/A error - The #N/A error happens when a value is not available for a formula or found in a given cell range, for example in the VLOOKUP or MATCH functions.
#GETTING_DATA error - The #GETTING_DATA error shows while external sources are loading, this can indicate a delay in fetching the data or that the external source is unavailable right now.
5.2 The formula returns an unexpected value
To understand why a formula returns an unexpected value we need to examine the calculations steps in detail. Luckily, Excel has a tool that is really handy in these situations. Here is how to troubleshoot a formula:
- Select the cell containing the formula you want to examine in detail.
- Go to tab “Formulas” on the ribbon.
- Press with left mouse button on "Evaluate Formula" button. A dialog box appears.
The formula appears in a white field inside the dialog box. Underlined expressions are calculations being processed in the next step. The italicized expression is the most recent result. The buttons at the bottom of the dialog box allows you to evaluate the formula in smaller calculations which you control. - Press with left mouse button on the "Evaluate" button located at the bottom of the dialog box to process the underlined expression.
- Repeat pressing the "Evaluate" button until you have seen all calculations step by step. This allows you to examine the formula in greater detail and hopefully find the culprit.
- Press "Close" button to dismiss the dialog box.
There is also another way to debug formulas using the function key F9. F9 is especially useful if you have a feeling that a specific part of the formula is the issue, this makes it faster than the "Evaluate Formula" tool since you don't need to go through all calculations to find the issue..
- Enter Edit mode: Double-press with left mouse button on the cell or press F2 to enter Edit mode for the formula.
- Select part of the formula: Highlight the specific part of the formula you want to evaluate. You can select and evaluate any part of the formula that could work as a standalone formula.
- Press F9: This will calculate and display the result of just that selected portion.
- Evaluate step-by-step: You can select and evaluate different parts of the formula to see intermediate results.
- Check for errors: This allows you to pinpoint which part of a complex formula may be causing an error.
The image above shows cell reference C5 converted to hard-coded value using the F9 key. The YIELD function requires a numerical values larger than 0 (zero) in argument pr which is not the case in this example. We have found what is wrong with the formula.
Tips!
- View actual values: Selecting a cell reference and pressing F9 will show the actual values in those cells.
- Exit safely: Press Esc to exit Edit mode without changing the formula. Don't press Enter, as that would replace the formula part with the calculated value.
- Full recalculation: Pressing F9 outside of Edit mode will recalculate all formulas in the workbook.
Remember to be careful not to accidentally overwrite parts of your formula when using F9. Always exit with Esc rather than Enter to preserve the original formula. However, if you make a mistake overwriting the formula it is not the end of the world. You can “undo” the action by pressing keyboard shortcut keys CTRL + z or pressing the “Undo” button
5.3 Other errors
Floating-point arithmetic may give inaccurate results in Excel - Article
Floating-point errors are usually very small, often beyond the 15th decimal place, and in most cases don't affect calculations significantly.
Functions in 'Financial' category
The YIELD function function is one of 27 functions in the 'Financial' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form