Purpose

Return value

Syntax

=YIELDMAT(sd,md,id,rate,pr,[basis])
  • sd - Settlement date of the security.
  • md - Maturity date of the security.
  • id - Issue date of the security.
  • rate - Interest rate of security.
  • pr - Price per $100 face value.
  • basis - [optional] Coupon payments per year (annual = 1, semiannual = 2; quarterly = 4).

Using the YIELDMAT function

The YIELDMAT function returns the annual yield of a security that pays interest at maturity. In the example shown, the formula in F5 is:

=YIELDMAT(C9,C7,C8,C6,C5,C10)

with these inputs, the YIELDMAT function returns 0.081 which, or 8.10% when formatted with the percentage number format .

Entering dates

In Excel, dates are serial numbers . Generally, the best way to enter valid dates is to use cell references, as shown in the example. If you want to enter valid dates directly inside a function, the DATE function is the best approach.

Basis

The basis argument controls how days are counted. The PRICE function allows 5 options (0-4) and defaults to zero, which specifies US 30/360 basis . This article on Wikipedia provides a detailed explanation of available conventions.

BasisDay count
0 or omittedUS (NASD) 30/360
1Actual/actual
2Actual/360
3Actual/365
4European 30/360

Notes

  • In Excel, dates are serial numbers .
  • Settlement, maturity issue, and basis are truncated to integers
  • If settlement, maturity , or issue dates are not valid, YIELDMAT returns #VALUE!
  • YIELDMAT returns #NUM! if any of the following are true: rate < 0 pr <= 0 settlement >= maturity Basis is not 0-4

Purpose

Return value

Syntax

=CELL(info_type,[reference])
  • info_type - The type of information to return about the reference.
  • reference - [optional] The reference from which to extract information.

Using the CELL function

Use the CELL function to return a wide range of information about a reference . The type of information returned is given as info_type , which must be enclosed in double quotes (""). CELL can return a cell’s address, the filename and path for a workbook, and information about the formatting used in the cell. See below for a full list of info types and format codes .

CELL is a volatile function , and can cause performance issues in large or complex worksheets.

The CELL function takes two arguments: info_type and reference . Info_type is a text string that indicates the type of information requested. See the table below for a full list of info types. Reference is a cell reference. Reference is typically a single cell. If reference refers to more than one cell, CELL returns information about the first cell in reference. For certain kinds of information (like filename) the cell address used for reference is optional and can be omitted. However, if reference is not supplied, CELL will return the name of the current “active sheet” which may or may not be the sheet where the formula exists, and might even be in a different workbook. To avoid confusion, use A1 for reference.

Note: the CELL function is a volatile function and may cause performance issues in large or complex worksheets.

Examples

For example, to get the column number for C10:

=CELL("col", C10) // returns 3

To get the address of A1 as text:

=CELL("address",A1) // returns "$A$1"

To get the full path and workbook name for the current worksheet:

=CELL("filename",A1) // path + filename

CELL can also return format code information. For example, if A1 contains the number 100 with the currency number format applied, the CELL function will return “C2”:

=CELL("format",A1) // returns "C2"

When requesting the info_type “format” or “parentheses”, a set of empty parentheses “()” is appended to the format returned if the number format uses parentheses for all values or for positive values. For example, if A1 uses the custom number format (0), then:

=CELL("format",A1) // returns "F0()"

Info types

The following info_types can be used with the CELL function:

Info_typeDescription
addressreturns the address of the first cell in reference (as text).
colreturns the column number of the first cell in reference .
colorreturns the value 1 if the first cell in reference is formatted using color for negative values; or zero if not.
contentsreturns the value of the upper-left cell in reference . Formulas are not returned. Instead, the result of the formula is returned.
filenamereturns the file name and full path as text. If the worksheet that contains reference has not yet been saved, an empty string is returned.
formatreturns a code that corresponds to the number format of the cell. See below for a list of number format codes. If the first cell in reference is formatted with color for values < 0, then “-” is appended to the code. If the cell is formatted with parentheses, returns “() - at the end of the code value.
parenthesesreturns 1 if the first cell in reference is formatted with parentheses and 0 if not.
prefixreturns a text value that corresponds to the label prefix - of the cell: a single quotation mark (’) if the cell text is left-aligned, a double quotation mark (”) if the cell text is right-aligned, a caret (^) if the cell text is centered text, a backslash () if the cell text is fill-aligned, and an empty string if the label prefix is anything else.
protectreturns 1 if the first cell in reference is locked or 0 if not.
rowreturns the row number of the first cell in reference .
typereturns a text value that corresponds to the type of data in the first cell in reference : “b” for blank when the cell is empty, “l” for label if the cell contains a text constant, and “v” for value if the cell contains anything else.
widthreturns the column width of the cell, rounded to the nearest integer. A unit of column width is equal to the width of one character in the default font size. Note: this value comes back as an array with two values {width,default} where width is the column width and default is a boolean value that indicates if the width is the default column width.

Format codes

The table below shows the text codes returned by CELL when “format” is used for info_type .

Format code returnedFormat code meaning
GGeneral
F00
,0#,##0
F20
,2#,##0.00
C0$#,##0_);($#,##0)
C0-$#,##0_);Red
C2$#,##0.00_);($#,##0.00)
C2-$#,##0.00_);Red
P00%
P20.00%
S20.00E+00
G# ?/? or # ??/??
D1d-mmm-yy or dd-mmm-yy
D2d-mmm or dd-mmm
D3mmm-yy
D4m/d/yy or m/d/yy h:mm or mm/dd/yy
D5mm/dd
D6h:mm:ss AM/PM
D7h:mm AM/PM
D8h:mm:ss

Notes

  • The CELL function is a volatile function and may cause performance issues in large or complex worksheets.
  • Reference is optional for some info types, but use an address like A1 to avoid unexpected behavior.