Excel Add in Fuction
Excel Add in Fuction
Formula Overview
The following topics introduce common Bloomberg formula syntax and best practices.
Formula Construction
Each type of Bloomberg Professional® service formula has its own specific syntax, which is described in the corresponding
topic for the formula. However, there are general rules that apply when constructing all Bloomberg formulas.
Each formula must be entered into a single cell on your Excel spreadsheet. Formulas are not case-sensitive.
Each formula consists of required and optional parameters, which vary depending on the type of formula you create. The
required parameters must be included in the formula for the formula to import data. The optional parameters can be added to
control the appearance, format, and calculation of the imported data.
Each parameter within the formula must be surrounded by quotation marks and separated by a comma. For example:
Note: If European regional settings have been selected for Excel, parameters must be separated by a semicolon. For example,
=BCurve("EUR .6M";"CurveDate=Today";"View=ALL").
Optional parameters can be formatted to include the parameter name and value within one set of quotation marks (i.e.,
"Per=M") or within separate sets of quotation marks (i.e., "Per","M"). For example:
Finally, each parameter can be included in the formula as a literal reference, a cell reference, or a cell reference range. For
more information on cell referencing, see Cell Referencing.
Cell Referencing
There are several methods for including a parameter within a Bloomberg formula. You can include a literal reference, a cell
reference, or a cell reference range. You can use a single specific method or all of the methods at once within the same
formula. The benefit of using cell references and cell reference ranges is that it allows you to write a formula once and apply it
to multiple securities, data fields, or other parameters.
The simplest method of formula creation uses literal references, which requires you to include the parameter and its value
directly in the formula. For example:
When creating multiple formulas on the same spreadsheet that use the same parameters, you can save time by using cell
references. You can type the parameter in a cell and then reference the cell within the formulas.
2
D A P I < G O > Help Page
|Hint| To add a cell reference to a formula, you can simply click the corresponding cell while typing the formula.
For example:
=BDP(A1,B1)
Cell A1 contains the name of the security (GOOG US EQUITY) and cell B1 contains the name of the data field (PX LAST).
=BDH(A1,B1,A2,B2,A3,B3,A4,B4)
Cell A1 contains the name of the security (GOOG US EQUITY), cell B1 contains the name of the data field (PX LAST), cell A2
contains the start date, cell B2 contains the end date, cell A3 contains the first optional parameter (Per), cell B3 contains the
value of the first optional parameter (m), cell A4 contains the second optional parameter (DTS), and cell B4 contains the
value of the second optional parameter (H).
When working with multiple optional parameters, you can include the optional parameters as a range of cells instead of
referencing each individual cell. For example:
=BDH(A1,B1,A2,B2,A3:A4,B3:B4)
Cell A1 contains the name of the security (GOOG US EQUITY), cell B1 contains the name of the data field (PX LAST), cell A2
contains the start date, cell B2 contains the end date, cell A3 contains the first optional parameter (Per), cell A4 contains the
second optional parameter (DTS), cell B3 contains the value of the first optional parameter (m), and cell B4 contains the
value of the second optional parameter (H).
=BDH(A1,B1,A2,B2,A3:A6,B3:B6)
3
D A P I < G O > Help Page
Cell A1 contains the name of the security (GOOG US EQUITY), cell B1 contains the name of the data field (PX LAST), cell A2
contains the start date, cell B2 contains the end date, the cells in column A from A3 through A6 contain the optional
parameters, and the cells in column B from B3 through B6 contain the corresponding values.
Finally, after creating a formula that contains cell references, you can apply the formula to additional securities, data fields, or
parameters that are listed on your spreadsheet. You can click the lower right corner of the cell containing the formula and drag
the formula across columns or rows. The cell references change corresponding to the shifted formula, but you can control how
the cell references change by locking the cell reference in several ways.
C4 indicates that neither the column nor the row are locked. If you drag the formula, both the column and the row of the
reference change.
$C$4 indicates that both the column and the row are locked in place. If you drag the formula, the cell reference does not
change.
C$4 indicates the row is locked in place. If you drag the formula, the row in the cell reference remains the same, but the
column changes.
$C4 indicates the column is locked in place. If you drag the formula, the column in the cell reference remains the same, but
the row changes.
For an example of locking the cell references and dragging the formula to apply to multiple fields, see Dragging the Formula.
|Hint| To quickly lock cell references when adding them to formulas, you can press the <F4> key after typing the cell reference
or clicking the cell:
Pressing the <F4> key once locks both the column and the row ($C$4).
Pressing the <F4> key twice locks the row but not the column (C$4).
Pressing the <F4> key three times locks the column but not the row ($C4).
Pressing the <F4> key four times unlocks both the column and the row (C4).
4
D A P I < G O > Help Page
This topic provides a practical example for locking cell references within a formula and applying the formula to multiple data
fields on the spreadsheet.
Steps:
2. In cell B1, C1, and D1, enter each data field (PX LAST, PX HIGH, and PX LOW).
3. In cell B2, begin typing a BDP formula by entering "=bdp(", then click cell A2 and press the <F4> key once.
The cell reference locks both the column and the row ($A$2).
4. Continue typing the formula by entering a comma, then click cell B1 and press the <F4> key twice.
The cell reference locks the row in place but allows the column to change (B$1).
5. Finish typing the formula by closing the parentheses, then press <GO>.
5
D A P I < G O > Help Page
The most recent price of Google Inc.'s equity appears in cell B2.
6. Select cell B2, then click the lower right corner of the cell and drag the formula across columns C and D.
The formula copies to cells C2 and D2. Because the cell reference pointing to the security was locked ($A$2), the same
security is used in all of the formulas. Because the cell reference pointing to the data field was row locked but not column
locked (B$1), the formula in cell C2 points to the data field in cell C1 (=BDP($A$2,C$1)) and the formula in cell D2 points to the
data field in cell D1 (=BDP($A$2,D$1)).
The high price of Google Inc.'s equity appears in cell C2 and the low price appears in cell D2.
Security Syntax
Most Bloomberg formulas require you to specify the security to which the formula applies. The security identifier (ticker) must
conform to the following syntax:
In this syntax, only the Name and Yellow Key components are required. The other six elements are used for qualifications and
depend on the <Yellow Key> and type of security used.
Examples:
Note: For the correct syntax for FX broken date forwards, see FX Broken Date Forwards Syntax.
Component Definition
6
D A P I < G O > Help Page
Component Definition
When the Type component does not appear, the Name is assumed to be the ticker
name. However, the name can also represent a different form of identification, as
defined by the Type.
For example, AAPL in AAPL Equity, IBM in IBM 7.5 06/15/13 Corp, 882330AF0 in
882330AF0 Cusip, and US882330AF05 in US882330AF05 Corp Isin.
Exchange For equity securities, the two-character mnemonic for the exchange on which the
instrument is traded.
For example, UN, which stands for New York Stock Exchange, in AAPL UN Equity and
LN, which stands for London Stock Exchange, in EVR LN Equity.
Coupon For fixed income securities, the number specifying the fixed rate coupon.
Maturity For fixed income securities, the due date of the specified security. The date is specified
in one of the following formats: mm/dd/yy, mm/dd/yyyy, mm/yy, mm/yyyy.
7
D A P I < G O > Help Page
Component Definition
Pricing Source For fixed income securities and currencies, the source of the pricing and related data
for the security. This is a three or four letter code that represents the specific pricing
source. The pricing source you choose determines the data that is imported.
When specifying a pricing source for bonds, you must include an "@" symbol.
You can look up pricing sources to use with a specific security on the All Quotes (ALLQ)
function. For more information on ALLQ, see the ALLQ Help Page.
For example, BGN in T 5.125 04/01/01@BGN Corp, CBIL in IRELAND/ CBIL Curncy,
and BFIX in EURUSD BFIX Curncy.
If a pricing source is not specified, the formula uses the pricing source specified on the
Pricing Source Selection (PCS) function. For more information on PCS, see the PCS Help
Page.
Session For commodity futures, the trading session for which to import data.
For example, PIT in CLA PIT Comdty and COMB in COA COMB Comdty.
If a session is not specified, the formula uses the session specified for the exchange on
the Commodities Settings (CDEF) function. For more information on CDEF, see the
CDEF Help Page.
8
D A P I < G O > Help Page
Component Definition
Yellow Key The text equivalent for the Bloomberg yellow function (Market) keys. Yellow keys
include:
Govt (Sovereign)
Corp (Credit)
Mtge (Mortgage)
Muni (Municipal)
Pfd (Preferred)
Equity (Equity)
Comdty (Commodity)
Index (Index)
Curncy (Currency)
Note that the abbreviations for Commodity and Currency securities differ from the
abbreviation on the Bloomberg keyboard.
Type The type of Name used to identify a given security. Types include:
Aibd
Austria
Cedel
Cins (CUSIP International Numbering System - eight characters and one check
digit)
Cusipx (CUSIP-Exchange)
9
D A P I < G O > Help Page
Component Definition
Cusip (Committee on Uniform Securities Identification Procedures (eight characters
and one check digit)
Denmark
Dutch
Euroclr
Firmid
French (SICOVAM)
Isma
Italy
Japan
Jncomnum
Luxembrg
Misc
Norway
Rga
Spain
Swedenv
Tcm (Ticker-Coupon-Maturity)
10
D A P I < G O > Help Page
Component Definition
Tickerx (Ticker-Exchange)
Ticker
For example: Sedol1 in 2005973 Equity Sedol1 and Cusip in 882330AF0 Cusip.
Bloomberg API formulas (aka "functions") can include two types of parameters that affect the downloaded data: Function
Overrides (i.e., "optional parameters") and Field Overrides.
Function Overrides are universal to a formula type (e.g., BDP, BDH, and BDS), regardless of the data field(s) you are using in
the formula. For example, the function override Days is available to use in all BDH formulas.
Field Overrides are parameters that affect a specific field (e.g., BEST_EPS and TLD_CNV_ASK). The field overrides you can
use depend on the data field(s) you are using. For example, the field override BEST_FPERIOD_OVERRIDE can only be used
with relevant equity fields. It is not available when you are using an unrelated field (e.g., YLD_CNV_ASK).
Note: Certain overrides may overlap categories. For example, you can use both the function override Currency and the field
override EQY_FUND_CRNCY to change the currency of an equity fundamental that is downloaded in a BDH historical data
formula (such as when using the field BEST_EPS). When overrides overlap, please use the field override.
In the FX market, broken dates are dates that do not fall on a standard tenor on the forward curve. For example, you may want
to price a currency on a date that falls between 2M and 3M, which are standard dates. You can price this currency as a broken
date by either indicating a specific date, or the number of days forward from the current date (spot) or another specific date.
The base syntax for broken date forwards is: Base ISO/Term ISO Curncy
To this base, tails can be added to denote tenor, forward date, pricing date, pricing source, and market type. The tails can be
added in any order. For example:
Base ISO/Term ISO [Market Type] [Forward Date or Tenor or F] [Pricing Source] Curncy
Base ISO/Term ISO [Market Type] [Pricing Source] [Tenor or F]@[Pricing Date] Curncy
Base ISO/Term ISO [Market Type] [Pricing Source] [Forward Date]X[Pricing Date] Curncy
Note: Broken date forward tickers can only be used in BDP formulas and cannot be used in BDH formulas. For more
information on BDP formulas, see BDP (Current/Real-Time Data).
Component Definition
11
D A P I < G O > Help Page
Component Definition
Base ISO The base currency. For more information on the currency codes that you can use, see
the CURR Help Page.
Term ISO The term currency. For more information on the currency codes that you can use, see
the CURR Help Page.
Market Type The market type of the currency. Market types can also be Market Type for Base
ISO/Market Type for Foreign ISO. When only one market type is provided, it is used as
the market type of the currency that has a non-regular market type, if exactly one of
the two currencies has a non-regular market type.
O: Onshore
R: Regular
If market types are not provided, the default market types from the Foreign Exchange
Defaults: Market Type Defaults (XDF MKT) function are used for currencies having more
than one market type. Otherwise, the default value is R.
12
D A P I < G O > Help Page
Component Definition
Forward Date or The settlement date for the forward, which can be a date, a tenor, or an "F". An "F"
indicates that the forward date from the trading system database is used. If no forward
date is specified, spot is used.
Tenor or
F
The valid format for forward dates is MMDDYY. For example, 101215.
O/N: Overnight
13
D A P I < G O > Help Page
Component Definition
Valid values include a valid contributor or Bloomberg pricing source code. For
example, WMCO (WM/Reuters Fixings) or BGN (Bloomberg Generic Price). For more
information on WMCO, see the WMCO Help Page.
Note: Pricing contributors may require you to subscribe to their service in order to
receive their pricing via Bloomberg.
If the specified pricing source is not contributing quotes, depending on the settings in
the Foreign Exchange Defaults (XDF) function, either CMP(N/L/T) or BGN(L/T) is used.
For more information on the Bloomberg Composite (CMP) and BGN pricing sources,
see QFX <GO>.
Note: "N/L/T" indicates the market to use for trading day and local closing hours. N is
New York, L is London, and T is Tokyo.
If no pricing source is specified, the default pricing source for the cross currency on
XDF is used.
Examples
14
D A P I < G O > Help Page
15
D A P I < G O > Help Page
GBP/ F Curncy Forward date set Today XDF setting XDF setting (loads
GBP/Firm
Currency
according to
market
convention)
If you are currently experiencing issues importing credit default swap (CDS) data into Microsoft® Excel, this is most likely a
result of your pricing source default settings. CMA DataVision provides CDS pricing data on the BLOOMBERG
PROFESSIONAL® service terminal, but restricts access via Excel.
CMA pricing data was never available in Excel for non-subscribers. In the past, if you were defaulting to the CMA pricing
source for CDS on the terminal, you would typically download CBGN pricing in Excel by default. The system has recently been
updated to show an error (#N/A N/A) if you attempt to download a CMA price to Excel in order to avoid confusion on what
data you are downloading. For further questions regarding CMA subscriptions, you can reach out to CMA using the contact
information found on CMA <GO>.
To populate CDS prices in Excel without a subscription, please select an applicable pricing provider from the All Quotes (ALLQ)
function. You can either update your pricing defaults at the bottom of ALLQ or incorporate the pricing source in your ticker. For
example:
16
D A P I < G O > Help Page
For more information on ALLQ for derivatives, see the ALLS Help Page.
BDP formulas let you download current Bloomberg data. The following topics describe how to use BDP formulas.
BDP Description
Bloomberg Data Point (BDP) formulas allow you to import a single data point of current or continuously updating, real-time
data to a single cell in your Excel spreadsheet. You can import data across every market sector and type of data available on
the Bloomberg.
Note: To import real-time data, you must be enabled for the appropriate real-time exchange entitlements for the securities in
your formulas. To determine what subscriptions are required for a specific security, you can load the security in Bloomberg and
enter EXC <GO> to access the Current Exchange Subscription (EXC) function. After reviewing the required subscriptions, you
can subscribe to the appropriate exchange products on the Exchange Information System (EIS) function. For more information
on EXC, see the EXC Help Page. For more information on EIS, see the EIS Help Page.
You can customize the output of a BDP formula using override fields. For example, where there is a relationship between two
or more financial variables (such as price and yield), you can override or set a value for one of the variables and see the
outcome that this produces in the other variable. For more information on creating override formulas, see BDP & BDS:
Overrides.
BDP Syntax
BDP Examples
Dragging from FLDS
BDP & BDS: Overrides
BDP & BDS: Portfolio Data
BDP Syntax
Optional Parameters:
Fill
PCS
UpdateFrequency
Delayed
Security
17
D A P I < G O > Help Page
In a BDP formula, the required Security parameter is a single, valid Bloomberg security identifier.
For example: "AAPL US EQUITY", "IBM 7.5 06/15/2013 Corp", or "US459200AL50 ISIN"
In a formula: =BDP("AAPL US EQUITY", "PX LAST")
For more information on the correct syntax for security identifiers, see Security Syntax.
Field
In a BDP formula, the required Field parameter is a mnemonic representation of a Bloomberg data field that imports current or
real-time data.
For more information on searching for current fields, see Finding Current Fields. For more information on searching for real-
time fields, see Finding Real-Time Fields.
Fill
In a BDP formula, the optional Fill parameter applies when the formula returns an #N/A N/A error. Fill allows you to specify a
blank cell or a custom string of text to appear instead of the error.
PCS
In a BDP formula, for currency and fixed income securities, the optional PCS parameter allows you to specify a three or four
letter pricing source code, so you can specify the dealer or source providing the data you want to download for the security.
To find out the pricing sources you can use for a security and their codes, in the Bloomberg terminal, load the security and
enter ALLQ <GO>. (For example, enter EURUSD <Crncy> ALLQ <GO>.) For more information on the All Quotes (ALLQ)
function, see the ALLQ Help Page.
Note: When using the PCS parameter, do not specify a pricing source in the security's ticker (i.e., "EUR WMCO Curncy" or "DIS
7 03/01/32 @BGN Corp").
UpdateFrequency
18
D A P I < G O > Help Page
In a BDP formula with real-time data fields, the optional UpdateFrequency parameter allows you to specify frequency with
which you receive ticks from the Bloomberg backend, in milliseconds.
UpdateFrequency
Alias: UpdFreq
"UpdFreq=60000" = 1 minute
"UpdFreq=600000" = 10 minutes
"UpdFreq=3600000" = 1 hour
Note: For fields that import static data, UpdateFreq will return an error.
When this parameter is omitted from your formula (for real-time fields), the default value is "300" (300 milliseconds).
Delayed
For securities traded on an exchange, if you do not subscribe to real-time data from the exchange, the data you receive for the
security is delayed by 15 minutes. The Delayed parameter forces your BDP formula to always download the delayed stream of
data even if you are subscribed to real-time data.
When this parameter is omitted from your formula (for real-time fields), the default value is "False".
BDP Examples
19
D A P I < G O > Help Page
For additional detailed examples of the BDP formula, see the BDP tabs on the XLTP XAPI example spreadsheet.
You can automatically create a BDP formula by dragging and dropping a data field from the Field Search (FLDS) function into a
cell on your Excel spreadsheet.
Steps:
1. On FLDS, from the toolbar, select Options > Enable Drag & Drop.
2. In the upper left corner of the screen, search for data fields by entering the security ticker and keyword search term that you
want to use as search criteria, then press <GO>.
3. From the search results, drag a data field mnemonic to a cell on your Excel spreadsheet.
20
D A P I < G O > Help Page
A formula is automatically generated, which imports the value corresponding to the selected security and data field.
BDS formulas let you download sets of related data. The following topics describe how to use BDS formulas.
BDS Description
Bloomberg Data Set (BDS) formulas import multi-cell, descriptive data for a selected security. BDS formulas can only be used
with DataSets fields. For more information on searching for DataSets fields, see Finding Data Sets Fields.
You can occasionally customize the output of a BDS formulas using override fields. For example, you can import the predicted
mortgage cashflows for a mortgage security and specify the settle date, prepay type, and prepay speed that are used to
calculated these cashflows. For more information on creating override formulas, see BDP & BDS: Overrides.
BDS Syntax
BDS Examples
BDP & BDS: Overrides
BDP & BDS: Portfolio Data
BDS Syntax
Optional Parameters:
Aggregate
Array
Direction
EndCol
EndRow
Fill
Headers
PCS
Separator
SortAsc
21
D A P I < G O > Help Page
SortDesc
StartCol
StartRow
Security
In a BDS formula, the required Security parameter is a single, valid Bloomberg security identifier.
For example: "AAPL US EQUITY", "IBM 7.5 06/15/2013 Corp", or "US459200AL50 ISIN"
In a formula: =BDS("AAPL US EQUITY", "CIE_DES_BULK")
For more information on the correct syntax for security identifiers, see Security Syntax.
Field
In a BDS formula, the required Field parameter is the mnemonic representation of a Bloomberg data field that imports multiple
cells of data.
Valid values are Bloomberg data fields that import multiple cells of data (i.e., a DataSets field).
For more information on searching for DataSets fields, see Finding Data Sets Fields.
Aggregate
In a BDS formula, the optional Aggregate parameter allows you to aggregate the imported data into a single cell on your
spreadsheet.
When this parameter is omitted from your formula, the default value is "No".
Array
In a BDS formula, the optional Array parameter allows you to import all values from the formula in an Excel array in a single cell.
This means that you can use Excel formulas such as SUM(), STDEV(), and AVERAGE() without the need to download the whole
series of data into multiple cells.
22
D A P I < G O > Help Page
When this parameter is omitted from your formula, the default value is "False".
Direction
In a BDS formula, the optional Direction parameter allows you to choose the manner in which data from the formula is
arranged on your spreadsheet.
H or Horizontal: Horizontal
V or Vertical: Vertical
When this parameter is omitted from your formula, the default value is "Vertical".
EndCol
In a BDS formula, the optional EndCol parameter allows you to define the ending column of the imported data.
For example, if the formula returns five columns of data without this parameter, you can specify "EndCol=4" to import columns
1-4 of the data.
You can use this parameter together with the StartCol, StartRow, and EndRow parameters to narrow down the imported data.
EndRow
In a BDS formula, the optional EndRow formula allows you to define the ending row of the imported data.
For example, if the formula returns five rows of data without this parameter, you can specify "EndRow=4" to import rows 1-4 of
the data.
You can use this parameter together with the StartRow, StartCol, and EndCol parameters to narrow down the imported data.
Fill
In a BDS formula, the optional Fill parameter is the filler value that is applied when the BDS formula returns an #N/A N/A error
for an imported value.
23
D A P I < G O > Help Page
Headers
In a BDS formula, the optional Headers parameter allows you to display column headers for the imported data.
When this parameter is omitted from your formula, the default value is "No".
PCS
In a BDS formula, for currency and fixed income securities, the optional PCS parameter allows you to specify a three or four
letter pricing source code, so you can specify the dealer or source providing the data you want to download for the security.
To find out the pricing sources you can use for a security and their codes, in the Bloomberg terminal, load the security and
enter ALLQ <GO>. (For example, enter EURUSD <Crncy> ALLQ <GO>.) For more information on the All Quotes (ALLQ)
function, see the ALLQ Help Page.
Note: When using the PCS parameter, do not specify a pricing source in the security's ticker (i.e., "EUR WMCO Curncy" or "DIS
7 03/01/32 @BGN Corp").
Separator
In a BDS formula, the optional Separator parameter allows you to specify the separator to use when aggregating BDS data into
a single cell with the Aggregate parameter.
B: Blank
C: Comma
SC: Semicolon
24
D A P I < G O > Help Page
When this parameter is omitted from your formula, the default value is "B".
SortAsc
In a BDS formula, the optional SortAsc parameter sorts the table by a specific column in ascending order.
Valid values include the column name or number by which you want to sort.
For example, when using the data field MTG_CASH_FLOW: "SortAsc=Principal Paid" or "SortAsc=3"
In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "SortAsc=3")
SortDesc
In a BDS formula, the optional SortDesc parameter sorts the table by a specific column in descending order.
Valid values include the column name or number by which you want to sort.
For example, when using the data field MTG_CASH_FLOW: "SortDesc=Principal Paid" or "SortDesc=3"
In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "SortDesc=3")
StartCol
In a BDS formula, the optional StartCol parameter allows you to define the starting column of the imported data.
For example, if the formula returns five columns of data without this parameter, you can specify "StartCol=2" to import columns
2-5 of the data.
You can use this parameter together with the EndCol, StartRow, and EndRow parameters to narrow down the imported data.
StartRow
In a BDS formula, the optional StartRow parameter allows you to define the starting row of the imported data.
For example, if the formula returns five rows of data without this parameter, you can specify "StartRow=2" to import rows 2-5 of
the data.
You can use this parameter together with the EndRow, StartCol, and EndCol parameters to narrow down the imported data.
BDS Examples
25
D A P I < G O > Help Page
For additional detailed examples of the BDS formula, see the BDS and BDS Yield Curves tabs on the XLTP XAPI example
spreadsheet.
Overrides let you modify the default data returned by a BDP or BDS formula. The following topics describe how to use BDP
and BDS overrides.
Overrides Description
BDP and BDS override formulas allow you to customize the output of a BDP or BDS formula. For example, where there is a
relationship between two or more financial variables (such as price and yield), you can override or set a value for one of the
variables and see the outcome that this produces in the other variable. Overrides also allow you to perform calculations on a
time series of data (using interval fields) or specify the type of data you want to import (for example, you can import the
predicted mortgage cashflows for a mortgage security and specify the settle date, prepay type, and prepay speed that are
used to calculated these cashflows or import the estimated dividend per share from a specific broker).
|Hint| For more information about interval fields, see the Interval Calculations - Tutorial with Examples spreadsheet.
Overrides Syntax
Overrides Examples
Dragging from FLDS
Overrides Syntax
=BDP(Security,Field,Override Field,Override Field Value, [Override Field], [Override Field Value]...[optional parameter(s)])
or
26
D A P I < G O > Help Page
For more information on the correct syntax for security identifiers, see
Security Syntax.
For more information on searching with the Field Search (FLDS) function in
Bloomberg, see Finding Override Fields.
Override Field and Override Field The mnemonic representation of a Bloomberg data field that can override
Value the Field and the override value you want to use.
If the override value is a date, you must enter it using the following format:
YYYYMMDD.
For a list of optional parameters, see BDP (Current/Real-Time Data) and BDS (Data Sets).
Overrides Examples
27
D A P I < G O > Help Page
=BDP("VZ 5.15 09/15/23 Corp", "YAS ASW SPREAD", "YAS BOND PX", "101", "YAS WORKOUT DT", "20151105", "YAS
WORKOUT PX", "101.51")
Imports the ASW spread of the Verizon Communications bond, calculated using a price of 101, a workout date of November
5, 2015, and a workout price of 101.51.
=BDP("AAPL US Equity", "CUST TRR RETURN ANNUALIZED", "CUST TRR START DT=20130126", "CUST TRR END
DT=20130426")
Imports the total return of the Apple Inc. equity between January 26, 2013 and April 26, 2013.
=BDS("03072SU45 Mtge", "MTG CASH FLOW", "SETTLE DT=20130225", "MTG PREPAY TYP=CPR", "MTG PREPAY
SPEED=11.5")
Imports the projected future cashflows of AMSI 2005-R11 A1 Mtge using a settle date of February 25, 2013 and a prepay
speed of 11.5 CPR.
For additional detailed examples of BDP override formulas, see the BDP Overrides tab on the XLTP XAPI example spreadsheet.
You can automatically create a BDP override formula by dragging and dropping a data field from the Field Search (FLDS)
function into a cell on your Excel spreadsheet.
Steps:
1. On FLDS, from the toolbar, select Options > Enable Drag & Drop.
2. In the upper left corner of the screen, search for data fields by entering the security ticker and keyword search term that you
want to use as search criteria, then press <GO>.
28
D A P I < G O > Help Page
Details about the data field appear on a new screen, such as the field's definition and related fields. If the data field's value
can be recalculated by specifying inputs in the formula, in the middle of the screen, the Override option appears in amber.
4. Select Override.
Override fields that can be used to recalculate the data field's value appear.
5. Select the fields you want to use as overrides and enter a new value for each field in the Value column, then press <GO>.
29
D A P I < G O > Help Page
6. Drag the data field's value into a cell on your Excel spreadsheet.
A formula is automatically generated, which imports the value corresponding to the selected security, data field, and override
field values.
BDH formulas let you download historical Bloomberg data. The following topics describe how to use BDH formulas.
BDH Description
Bloomberg Data History (BDH) formulas allow you to import historical data for a selected security in Microsoft® Excel. You can
import a single historical data point or a historical time series of data.
In addition to historical end of day data, you can import historical fundamental data, historical earnings estimates, and
historical intraday data. For syntax and parameters specifically related to fundamentals/estimates, intraday bars, and intraday
ticks, see BDH: Fundamentals/Estimates, BDH: Intraday Bars, and BDH: Intraday Ticks.
BDH Syntax
BDH Examples
BDH Syntax
Note: When you specify a single date in the formula, you cannot use optional parameters.
Optional Parameters:
30
D A P I < G O > Help Page
Array
CapChg
CDR
CshAdjAbnormal
CshAdjNormal
Currency
DateFormat
Dates
Days
Direction
Factor
Fill
Historical Rebase Value Override
PCS
Period
Points
Quote
QuoteType
Sort
TZ
UseDPDF
Security
In a BDH formula, the required Security parameter is a single, valid Bloomberg security identifier.
For example: "AAPL US EQUITY", "IBM 7.5 06/15/2013 Corp", or "US459200AL50 ISIN"
In a formula: =BDH("AAPL US EQUITY", "PX LAST", "09/14/2012")
For more information on the correct syntax for security identifiers, see Security Syntax.
Field
In a BDH formula, the required Field parameter is the mnemonic representation of a Bloomberg data field that imports
historical data.
For more information on searching for historical data fields, see Finding Historical Fields.
Date
31
D A P I < G O > Help Page
In a BDH formula, the Date parameter is required if you are looking to import a single data point for a specific historical date.
A specific date. The date must be in a format consistent with your computer's defaults, i.e., MM/DD/YYYY in the US or
DD/MM/YYYY in Europe. For example, in the US, you would enter the date May 16, 1999, as 05/16/1999.
A fiscal date. For more information on fiscal dates, see Fiscal/Relative Dates.
Start Date
In a BDH formula, the Start Date parameter is required if you are looking to import a time series of historical data between a
start and an end date.
A specific date. The date must be in a format consistent with your computer's defaults, i.e., MM/DD/YYYY in the US or
DD/MM/YYYY in Europe. For example, in the US, you would enter the date May 16, 1999, as 05/16/1999.
A fiscal or relative date. For more information on fiscal and relative dates, see Fiscal/Relative Dates.
End Date
In a BDH formula, the End Date parameter is required if you are looking to import a time series of historical data between a
start and an end date.
A current or historical date that is equal to or later than the Start Date. (An End Date cannot be in the future.)
A specific date.
Note: The date must be in a format consistent with your computer's defaults, i.e., MM/DD/YYYY (or MM/DD/YY) in the US or
DD/MM/YYYY (or DD/MM/YY) in Europe. For example, in the US, you would enter the date May 16, 1999 as 05/16/1999 or
05/15/99.
A fiscal or relative date. For more information on fiscal and relative dates, see Fiscal/Relative Dates.
Double quotation marks (""), which indicates the current date.
LRP, which indicates last reported period.
32
D A P I < G O > Help Page
Array
In a BDH formula, the optional Array parameter allows you to import all values for the time series in an Excel array in a single
cell. This means that you can use Excel formulas such as SUM(), STDEV(), and AVERAGE() without the need to download the
whole series of data into multiple cells.
When this parameter is omitted from your formula, the default value is "False".
CapChg
In a BDH formula, the optional CapChg parameter indicates that historical pricing and/or volume is adjusted to reflect Spin-
Offs, Stock Splits/Consolidations, Stocks Dividend/Bonus, Rights Offerings/Entitlement.
For more information on these adjustments, see the DPDF Help Page.
CDR
In a BDH formula, the optional CDR parameter applies the specified settlement calendar to the formula.
Bloomberg two-letter calendar codes: Download data for all trading days in the calendar. For a full list of calendar codes,
see CDR <GO>.
5D: Download data for all weekdays (when the Period is daily).
7D: Download data for all calendar days (when the Period is daily).
Note: Bloomberg recommends using the CDR parameter instead of the Days parameter to specify all weekdays or all calendar
days for the daily data you want to download. For example, instead of using DAYS=A for daily data, you should use CDR=7D.
Instead of DAYS=W for daily data, you should use CDR=5D.
You can specify two or more calendar codes by separating each code with an operator:
&: Specifies an intersection of trading days, i.e., a data point is downloaded if the date is a valid trading day in both
exchanges. For example, "CDR=FD&EN" specifies that a data point is downloaded for dates that are trading days in both
the Federal Reserve and English calendars.
33
D A P I < G O > Help Page
|: Specifies a union of trading days, i.e., a data point is downloaded if the date is a valid trading day in either exchange. For
example, "CDR=FD|EN" specifies that a data point is downloaded for dates that are trading days in either the Federal
Reserve or English calendar.
Compound statements are not supported, e.g., "CDR=(US&JN)|GB".
Note: The CDR parameter is only valid for daily periodicity. When using the CDR parameter with other Period settings, an
"Invalid Parameter" error is displayed.
|Hint| The Days parameter has known issues when a formula also contains the CDR parameter. If you want to output all
calendar days and specify the calendar code for a specific region or exchange, you can combine calendars using the CDR
parameter. For example, =BDH("7974 JT Equity", "px_last", "12/20/17", "12/31/17", "Dir=V", "CDR=7D|TK", "Dts=s", "fill=b")
downloads a time series with all calendar days, but also values for the 25th and 26th, because this security trades on Tokyo
Stock Exchange and the 24th/25th are not holidays.
CshAdjAbnormal
In a BDH formula, the optional CshAdjAbnormal parameter indicates that historical pricing and/or volume is adjusted to reflect
Special Cash, Liquidation, Capital Gains, Long-Term Capital Gains, Short-Term Capital Gains, Memorial, Return of Capital,
Rights Redemption, Miscellaneous, Return Premium, Preferred Rights Redemption, Proceeds/Rights, Proceeds/Shares,
Proceeds/Warrants.
For more information on these adjustments, see the DPDF Help Page.
CshAdjNormal
In a BDH formula, the optional CshAdjNormal parameter indicates that historical pricing and/or volume is adjusted to reflect
Regular Cash, Interim, 1st Interim, 2nd Interim, 3rd Interim, 4th Interim, 5th Interim, Income, Estimated, Partnership Distribution,
Final, Interest on Capital, Distribution, Prorated.
For more information on these adjustments, see the DPDF Help Page.
Currency
In a BDH formula, the optional Currency parameter allows you to choose the currency in which to download historical values in
Microsoft® Excel.
Valid values for the parameter are currency codes. For a list of currency codes, see the CURR Help Page.
34
D A P I < G O > Help Page
The syntax for the parameter is: "FX=[currency code]", "Currency=[currency code]", or "Curr=[currency code]"
For example, the following formula downloads the daily last price of IBM between September 14, 2016, and January 31, 2017
(each last price appears in Euros): =BDH("IBM US EQUITY", "PX LAST", "09/14/2016", "1/31/2017", "FX=EUR")
DateFormat
In a BDH formula, the optional DateFormat parameter allows you to choose the format of the dates for the historical time
series.
Alias: DtFmt
P or Periodic: Uses the periodic/relative date format (for example, FQ1 2006).
F: Uses the fundamental date format (for example, 2FQ 2012).
D or Date: Uses the regular date format (i.e., MM/DD/YYYY).
B or Both: Uses both the regular date format and the fundamental date format (for example, 06/30/2012 & 2FQ 2012)
PI: Uses the periodic date format with an indicator that shows whether the value is an actual historical value (A) or an
estimate (E) (for example, FQ2 2012A).
FI: Uses the fundamental date format with an indicator that shows whether the value is an actual historical value (A) or an
estimate (E) (for example, 2FQ 2012A).
DI: Uses the regular date format with an indicator that shows whether the value is an actual historical value (A) or an
estimate (E) (for example, 06/30/2012A).
When this parameter is omitted from your formula, the default value is "Date".
Dates
In a BDH formula, the optional Dates parameter allows you to show or hide the dates for the historical time series.
Alias: Dts
When this parameter is omitted from your formula, the default value is "Show".
35
D A P I < G O > Help Page
Days
In a BDH formula, the optional Days parameter allows you to exclude or include non-trading days in the imported data (i.e.,
days when no data is available).
Note: Bloomberg recommends using the CDR parameter instead of the Days parameter for daily data. For example, instead of
using DAYS=A, you should use CDR=7D. Instead of DAYS=W, you should use CDR=5D.
Note: Please use "CDR=5D" instead for daily data. This avoids problems with tickers that have occasional Saturday/Sunday
numbers, such as KOSPI <Index>.
Note: Please use "CDR=7D" instead for daily data. The CDR override is a more reliable way to output a time series that
includes all calendar days.
When this parameter is omitted from your formula, the default value is "Trading".
If you specify weekdays or all calendar days, you can use the Fill parameter to specify the data or text that is imported for non-
trading days.
Note: The Days parameter has known issues when a formula also contains the CDR parameter. If you want to output all
calendar days and specify the calendar code for a specific region or exchange, you can combine calendars using the CDR
parameter. For example, =BDH("7974 JT Equity", "px_last", "12/20/17", "12/31/17", "Dir=V", "CDR=7D|TK", "Dts=s", "fill=b")
downloads a time series with all calendar days, but also values for the 25th and 26th, because this security trades on Tokyo
Stock Exchange and the 24th/25th are not holidays.
Direction
In a BDH formula, the optional Direction parameter allows you to choose the manner in which data from the formula is
arranged on your spreadsheet.
H or Horizontal: Horizontal
V or Vertical: Vertical
Factor
36
D A P I < G O > Help Page
In a BDH formula, the optional Factor parameter allows you to provide a value with which to scale the historical time series of
data.
Valid values are any number, including real, positive, and negative numbers.
Fill
In a BDH formula, the optional Fill parameter is the filler value for non-trading days.
If the CDR parameter is set to "7D" or the Days parameter is set to display weekdays or all calendar days, then the Fill
parameter allows you to specify the data or text that appears for any non-trading days.
Note: The previous data appears only if the data occurred in the last 30 days. If the data is older than 30 days, the #NA NA
error appears instead.
In a BDH formula, the optional Historical_Rebase_Value_Override parameter lets you set a value as the baseline for historical
comparison.
The value you specify becomes the first data point for your historical range, with subsequent values calculated relative to it.
For example:
37
D A P I < G O > Help Page
PCS
In a BDH formula, the optional PCS parameter, for currency and fixed income securities, allows you to specify a three or four
letter pricing source code, so you can specify the dealer or source providing the data you want to download for the security.
To find out the pricing sources you can use for a security and their codes, in the Bloomberg terminal, load the security and
enter ALLQ <GO>. (For example, enter EURUSD <Crncy> ALLQ <GO>.) For more information on the All Quotes (ALLQ)
function, see the ALLQ Help Page.
Note: When using the PCS parameter, do not specify a pricing source in the security's ticker (i.e., "EUR WMCO Curncy" or "DIS
7 03/01/32 @BGN Corp").
Period
In a BDH formula, the optional Period parameter allows you to set the interval within a fixed period of time for the imported
data.
Alias: Per
D: Daily
W: Weekly
M: Monthly
Q: Quarterly
S: Semi-annual
Y: Yearly
The Calendar (C), Fiscal (F), or Actual (A) modifiers allow you to choose a calendar type for the periods. The modifier should
precede the base period. F can only be used with Q, S, and Y.
When this parameter is omitted from the formula, the default value is "CD" (calendar daily).
Points
In a BDH formula, the optional Points parameter allows you to specify the number of data points to download from the end
date.
The data points are determined by the interval you have selected with the Period parameter.
38
D A P I < G O > Help Page
For example: "Points=5" imports the five most recent data points from the entire data series as specified in the formula.
In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Points=10")
Quote
In a BDH formula, the optional Quote parameter allows you to choose whether historical data is imported as close or average
values to Microsoft® Excel. This parameter can be used with the following data fields: PX_LAST, PX_OPEN, PX_HIGH, PX_LOW,
PX_BID, PX_ASK, and YLD_YTM_MID.
Note: To use this parameter, the Period parameter must be set to weekly or greater.
C or Close: The values at the close of each period are imported. For example, "Quote=C","Per=CW" imports the value at
the close of each calendar week.
A, G, or Average: The daily average values for each period are imported. For example, "Quote=G","Per=CW" imports the
daily average over each calendar week.
For example, the following formula imports a time series of the average monthly high price of Apple Inc.'s equity for each
month between January 1, 2016, and December 31, 2016: =BDH("AAPL US EQUITY", "PX HIGH", "1/1/2016", "12/31/2016",
"Per=cm", "Quote=G")
When this parameter is omitted from the formula, the default value for the parameter is "Close".
QuoteType
In a BDH formula, the optional QuoteType parameter, for fixed income securities quoted in yield, allows you to select the
format for price quotes when using data fields like "PX LAST".
Alias: QtTyp
When this parameter is omitted from the formula, the default value is "Yield".
Sort
In a BDH formula, the optional Sort parameter allows you to sort the data by time or dates.
C, A, Ascend, Chronological, or False: Sorts the data from earliest to most recent data.
R, D, Descend, Reverse, or True: Sorts the data from most recent to earliest data.
39
D A P I < G O > Help Page
When this parameter is omitted from the formula, the default value is "Ascend".
TZ
In a BDH formula, the optional TZ parameter allows you to define the timezone for the data.
City: The city that represents the desired timezone. For example, "New York".
Offset from GMT: The difference between the desired timezone and Greenwich Mean Time. For example, "U-5" specifies
the time zone 5 hours behind GMT, i.e. New York.
When this parameter is omitted from the formula, the time zone follows your PC settings.
UseDPDF
In a BDH formula, the optional UseDPDF parameter indicates whether the formula uses the same pricing defaults for
distributions as those set on your Dividend & Corporate Action Settings (DPDF) function.
When this parameter is omitted from the formula, the default value is "Yes".
BDH Examples
=BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "FX=EUR", "Days=A", "Fill=Not Applicable")
Imports a daily time series of closing prices for International Business Machine Inc.'s equity between September 14, 2012,
and January 31, 2013. The prices are converted to euros and values for all calendar days within the specified time period
appear. On non-trading days, the text string "Not Applicable" appears instead of a value.
40
D A P I < G O > Help Page
Imports a monthly time series of closing prices for the EURUSD cross currency between January 1, 2012 and December 31,
2012. The imported prices appear horizontally instead of vertically, and the row of corresponding dates for each price does
not appear.
For additional detailed examples of the BDH formula, see the BDH and BDH Relative Dates tabs on the XLTP XAPI example
spreadsheet.
41