0% found this document useful (0 votes)
106 views40 pages

Excel Add in Fuction

Uploaded by

thuyvu86210
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views40 pages

Excel Add in Fuction

Uploaded by

thuyvu86210
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

D A P I < G O > Help Page

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:

=BDP("GOOG US EQUITY","PX LAST")


=BCurve("EUR .6M","CurveDate=Today","View=ALL")
=BPGE("1102 1 274","7")

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:

=BDH("AAPL US EQUITY","PX LAST","9/15/2012","","Per=m","Dts=h") or


=BDH("AAPL US EQUITY","PX LAST","9/15/2012","","Per","m","Dts","h")

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:

=BDP("GOOG US EQUITY","PX LAST")


=BDH("AAPL US EQUITY","PX LAST","09/15/2012","","Per","m","Dts","h")

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.

References are locked in place using the $ symbol:

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

Dragging the Formula

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:

1. In cell A2, enter the security (GOOG US EQUITY).

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:

<Name> [Exchange] [Coupon] [Maturity] [Pricing Source][Session] <Yellow Key> [Type]

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:

"INDU Index" (Dow Jones Industrial Average Index)


"BT/A LN Equity" (British Telecom Stock)
"594918104 Equity Cusip" (Microsoft Corp Stock)
"GT30 Govt" (30-year US Treasury bond)
"EUR BGNL Curncy" (Euro currency, using the Bloomberg London pricing source)
"DIS 7 03/01/32@BGN Corp" (Walt Disney Company US domestic bond, using the Bloomberg Generic pricing source)

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

Name The identifier of the security.

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.

For example, 5.125 in T 5.125 04/01/01 Corp.

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.

For example, 04/01/01 in T 5.125 04/01/01 Corp.

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.

Valid values include:

PIT (Day/pit session)

ELEC (Night/electronic session)

COMB (Combined sessions)

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)

M-Mkt (Money Market)

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.

For example, Mtge in FN 841068 Mtge, Comdty in CLA Comdty.

Type The type of Name used to identify a given security. Types include:

Aibd

Austria

Belg (SVM Code)

Cedel

Cins (CUSIP International Numbering System - eight characters and one check
digit)

Comnum (Common Number)

Cusip8 (Committee on Uniform Securities Identification Procedures (eight


characters)

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)

Ireland (Irish Sedol Number)

Isin (International Securities Identification Number)

Isma

Italy

Japan

Jncomnum

Luxembrg

Malaysia (Malaysian CATS Code)

Misc

Norway

Rga

Sedol1 (Stock Exchange Daily Official List [London])

Sedol2 (Stock Exchange Daily Official List [London])

Spain

Scm (State-Coupon-Maturity [Municipal])

Stcm (State-Ticker-Coupon-Maturity [Municipal])

Swedenv

Tcav (Ticker-Coupon-Age [Mortgage Generic])

Tcm (Ticker-Coupon-Maturity)

Tickerdiv (Ticker-Dividend [Preferred])

10
D A P I < G O > Help Page

Component Definition
Tickerx (Ticker-Exchange)

Ticker

Valoren (Telekurs Assigned Number [Switzerland])

Wertp (Werpapier Kenn-Nummer [Germany])

For example: Sedol1 in 2005973 Equity Sedol1 and Cusip in 882330AF0 Cusip.

Function Overrides vs Field Overrides

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.

FX Broken Date Forwards Syntax

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.

Valid values include:

N: Non-deliverable forward (NDF)

O: Onshore

R: Regular

For example, "USD/KRW N Curncy" and "SGD/MYR R/O Curncy".

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.

For more information on XDF, see the XDF Help Page.

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.

Valid formats for tenors are:

xY: Years (for example, 1Y. The maximum value is 30.)

xM: Months (for example, 2M. The maximum value is 30.)

xW: Weeks (for example, 1W. The maximum value is 100.)

xD: Days (for example, 20D. The maximum value is 365.)

S/N: Spot Next

T/N: Tomorrow Next

O/N: Overnight

For example, "USD/IDR 3M Curncy", "USD/IDR 10/12/15 Curncy", or "USD/IDR F


Curncy".

If no forward date is specified, spot is used.

13
D A P I < G O > Help Page

Component Definition

Pricing Source The contributor providing quotes for the forward.

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.

@ or A or X A delimiter between the settlement date and the pricing date.

For example, "USD/JPY 3M@101206 Curncy" or "USD/KRW 102506X101206 Curncy".

Pricing Date The date of the trade.

The valid format is MMDDYY. For example, 101215.

Examples

Ticker Settlement Pricing Date Pricing Source Market Type

USD/JPY Curncy Spot Today XDF setting Regular

14
D A P I < G O > Help Page

Ticker Settlement Pricing Date Pricing Source Market Type

USD/KRW N Spot Today XDF setting NDF


Curncy

USD/IDR O 3M 3 month forward Today XDF setting Onshore


Curncy

USD/COP N 11/1/2014 Today XDF setting NDF


11/01/14 Curncy

EUR/GBP TKF Spot Today TKF Regular


Curncy

USD/KRW N Spot Today WMCO NDF


WMCO Curncy

EUR/USD 1M BGN 1 month forward Today BGN Regular


Curncy

USD/JPY 3 month forward 10/12/2014 XDF setting Regular


3M@101214
Curncy

USD/KRW N 10/25/2014 10/12/2014 XDF setting NDF


102514@101214
Curncy

USD/JPY 3 month forward 10/12/14 XDF setting Regular


3MX101214
Curncy

USD/KRW N 10/25/14 10/12/14 XDF Setting NDF


102514X101214
Curncy

EUR/GBP 12/1/2014 Today WMCF Regular


12/01/14 3M
WMCF Curncy

15
D A P I < G O > Help Page

Ticker Settlement Pricing Date Pricing Source Market Type

USD/INR ABOC Spot Today CMP(N/L/T) or XDF Setting


Curncy BGN(/L/T),
depending on
your XDF settings

SGD/MYR R/O 3 month forward 05/28/14 BGN Regular/ Onshore


BGN 3MA052814
Curncy

For buy-side firms:

Ticker Settlement Pricing Date Pricing Source Market Type

USD/JPY F Curncy Forward date set Today XDF setting Regular

GBP/ F Curncy Forward date set Today XDF setting XDF setting (loads
GBP/Firm
Currency
according to
market
convention)

EUR/ 1M ABN 1 month forward Today ABN XDF setting (loads


Curncy EUR/Firm Currency
according to
market
convention)

Issues Importing CDS Data

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:

=BDP("BOFA CDS USD SR 5Y CBIN Corp","PX_LAST")

16
D A P I < G O > Help Page

Imports current values from the CBIN pricing source.

=BDH("BOFA CDS USD SR 5Y CBIN Corp","PX LAST","09/01/2013","09/30/2013")


Imports historical values from the CBIN pricing source.

For more information on ALLQ for derivatives, see the ALLS Help Page.

BDP (Current/Real-Time Data)

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

=BDP( Security, Field, [optional parameter(s)])

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 example: "PX LAST", "YAS BOND YLD", or "OPEN"


In a formula: =BDP("AAPL US EQUITY", "PX LAST")

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.

Valid values include:

B or Blank: A blank cell


A custom string of text

For example: "Fill=B" or "Fill=Not Applicable"


In a formula: =BDP("IBM 7 10/30/25 Corp", "YAS_BOND_YLD", "Fill=Not available")

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.

For example, "PCS=BGN" or "PCS=WMCO"


In a formula: =BDP("IBM 7 10/30/25 Corp", "YAS_BOND_YLD", "PCS=BGN")

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

The following rules apply:

The value must be in increments of 100.


The minimum update frequency is 300.

The following are some commonly used values:

"UpdFreq=60000" = 1 minute
"UpdFreq=600000" = 10 minutes
"UpdFreq=3600000" = 1 hour

Note: For fields that import static data, UpdateFreq will return an error.

For example, in a formula: =BDP("C US EQUITY", "VOLUME", "UpdFreq=60000")

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.

Valid values are:

True, T, Yes, or Y: Downloads the delayed data stream.


False, F, No, or N: Downloads the real-time data stream, if you are subscribed.

When this parameter is omitted from your formula (for real-time fields), the default value is "False".

For example: "Delayed=True"


In a formula: =BDP("AAPL US Equity", "PX_LAST", "Delayed=True")

BDP Examples

=BDP("AAPL US EQUITY", "PX LAST")


Imports the last price of Apple Inc.'s equity. The value is static; to update the value, you must re-open or manually refresh
the spreadsheet. For more information on refreshing the spreadsheet, see Refresh Workbooks.

=BDP("AAPL US EQUITY", "LAST PRICE")


Imports the most recent price of Apple Inc.'s equity. If you are enabled for the appropriate exchange subscriptions, the
value updates live on your spreadsheet.

19
D A P I < G O > Help Page

=BDP("IBM 7 10/30/25 Corp", "YAS_BOND_YLD")


Imports the most recent yield of IBM 7 ½ 06/15/13 Corp. The value is static; to update the value, you must re-open or
manually refresh the spreadsheet.

=BDP("C US EQUITY", "SALES_REV_TURN")


Imports the current sales, revenue, and turnover value for Citigroup Inc.

=BDP("C US EQUITY", "VOLUME", "UpdFreq=60000")


Imports the most recent volume of the Citigroup Inc. equity. If you are enabled for the appropriate exchange subscriptions,
the value updates live on your spreadsheet. The value is set to refresh every minute.

For additional detailed examples of the BDP formula, see the BDP tabs on the XLTP XAPI example spreadsheet.

Dragging from FLDS

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.

For more: FLDS Help Page.

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>.

The corresponding data fields appear.

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 (Data Sets)

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

=BDS( Security, Field, [optional parameter(s)])

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 example: "INDX_MEMBERS" or "HIST_CASH_FLOW"


In a formula: =BDS("AAPL US EQUITY", "CIE_DES_BULK")

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.

Valid values include "Yes" (or "Y") or "No" (or "N").

For example: "Aggregate=Y"


In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "Aggregate=Y")

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.

For more information, see Using the Array Parameter.

Valid values include "True" and "False".

22
D A P I < G O > Help Page

For example: "Array=True"


In a formula:=BDS("FN889579 Mtge", "MTG_CASH_FLOW", "Array=True")

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.

Alias: Dir, Orientation

Valid values include:

H or Horizontal: Horizontal
V or Vertical: Vertical

For example: "Dir=H"


In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "Dir=H")

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.

For example, in a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "StartCol=2", "EndCol=3")

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.

For example, in a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "StartRow=2", "EndRow=5")

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

Valid values include:

B or Blank: Imports a blank cell.


Any other value is used literally as a filler.

For example: "Fill=B" or "Fill=Not Applicable"


In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "Fill=Not available")

Headers

In a BDS formula, the optional Headers parameter allows you to display column headers for the imported data.

Valid values include "Yes" (or "Y") or "No" (or "N").

For example: "Headers=Y"


In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "Headers=Y")

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.

For example: "PCS=BGN" or "PCS=WMCO"


In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "PCS=WMCO")

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.

Valid values include:

B: Blank
C: Comma
SC: Semicolon

For example: "Separator=C"


In a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "Aggregate=Y", "Separator=SC")

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.

For example, in a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "StartCol=2", "EndCol=3")

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.

For example, in a formula: =BDS("FN889579 Mtge", "MTG_CASH_FLOW", "StartRow=2", "EndRow=5")

You can use this parameter together with the EndRow, StartCol, and EndCol parameters to narrow down the imported data.

BDS Examples

=BDS("AAPL US EQUITY", "CIE_DES_BULK")


Imports the description of Apple Inc.'s business as it appears on the Description (DES) function for AAPL US <EQUITY>. The
data appears across five rows on the spreadsheet.

25
D A P I < G O > Help Page

=BDS("FN889579 Mtge", "MTG_CASH_FLOW")


Imports the projected future cashflows for the mortgage security. The data returned includes the period number, date,
coupon, interest, principal paid, and principal balance, which appears across several columns and rows on the spreadsheet.

=BDS("FN889579 Mtge", "MTG_CASH_FLOW", "StartCol=2", "EndCol=4")


Imports a complete set of known historical cashflows starting from the bond issuance. Only the second, third, and fourth
columns of data are imported.

=BDS("FN889579 Mtge", "MTG_CASH_FLOW", "SortAsc=Principal Paid")


Imports the projected future cashflows for the mortgage security and sorts the table in ascending order by the amounts in
the "Prinicipal Paid" column.

For additional detailed examples of the BDS formula, see the BDS and BDS Yield Curves tabs on the XLTP XAPI example
spreadsheet.

BDP & BDS: Overrides

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

=BDP(Security,Field,Override Field=Override Field Value, [Override Field=Override Field Value]...[optional parameter(s)])

Required Parameters Description

26
D A P I < G O > Help Page

Required Parameters Description

Security A single, valid Bloomberg security identifier.

For example, "AAPL US EQUITY", "IBM 7.5 06/15/2013 Corp", or


"US459200AL50 ISIN".

For more information on the correct syntax for security identifiers, see
Security Syntax.

Field The mnemonic representation of a Bloomberg overridable data field.

For example, "YAS BOND YLD" or "MTG_CASH_FLOW".

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.

<helpscs-hint>|Hint|</helpscs-hint> Even when your system date defaults


are set to DD/MM/YYYY, you must enter the date for override formulas as
YYYYMMDD. If you receive an N/A error message for your formula or the
data does not look correct, please ensure that the date is entered
correctly.

For example, "YAS BOND PX=101" or "SETTLE DT=20130423".

For a list of optional parameters, see BDP (Current/Real-Time Data) and BDS (Data Sets).

Overrides Examples

=BDP("VZ 5.15 09/15/23 Corp", "YAS BOND PX","YAS BOND YLD","5")


Imports the price of the Verizon Communications bond, calculated using a yield of 5.

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("Eur2m Curncy", "PX BID", "FWD CURVE QUOTE FORMAT=outright")


Imports the bid price of the Euro 2 month forward as an outright rather than in points.

=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.

Dragging from FLDS

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.

For more: FLDS Help Page.

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

The corresponding data fields appear.

3. In the search results, click a data field.

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

The data field's value recalculates.

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 (Historical Data)

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

Single Historical Date: =BDH( Security, Field, Date)


Time Series of Historical Data Points: =BDH( Security, Field, Start Date, End Date, [optional parameter(s)])

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 example: "PX LAST" or "YLD_YTM_MID"


In a formula: =BDH("AAPL US EQUITY", "PX LAST", "09/14/2012")

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 current or historical date.

Valid values include:

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.

For example: "12/1/2012" or "FQ4 2000"


In a formula: =BDH("AAPL US EQUITY", "PX LAST", "09/14/2012")

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 current or historical date.

Valid values include:

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.

For example: "12/1/2012", "FQ4 2000", or "-4FQ"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "FX=EUR", "Days=A", "Fill=Not Applicable")

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.)

Valid values include:

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.

For example: "12/30/2012", "LRP", or "" (today's date)


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "FX=EUR", "Days=A", "Fill=Not Applicable")

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.

For more information, see Using the Array Parameter.

Valid values include "True" and "False".

For example: "Array=True"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Array=True")

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.

Valid values include "Yes" (or "Y") or "No" (or "N").

For example: "CapChg=Yes"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "CapChg=Yes")

CDR

In a BDH formula, the optional CDR parameter applies the specified settlement calendar to the formula.

Valid entries are:

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).

For example: "CDR=US" specifies the United States calendar


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "CDR=US")

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.

Valid values include "Yes" (or "Y") or "No" (or "N").

For example: "CshAdjAbnormal=Yes"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "CshAdjAbnormal=Yes")

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.

Valid values include "Yes" (or "Y") or "No" (or "N").

For example: "CshAdjNormal=Yes"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "CshAdjNormal=Yes")

Currency

In a BDH formula, the optional Currency parameter allows you to choose the currency in which to download historical values in
Microsoft® Excel.

Alias: FX, Curr

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

Valid values include:

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).

For example: "DtFmt=P"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "DtFmt=P")

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

Valid values include:

Show, S, or True: Shows the dates.


Hide, H, or False: Hides the dates.
O: Shows only the dates and not the data.

For example: "Dts=H" or "Dts=O"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Dts=H")

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.

Valid values include:

N, W or Weekdays: All weekdays.

Note: Please use "CDR=5D" instead for daily data. This avoids problems with tickers that have occasional Saturday/Sunday
numbers, such as KOSPI <Index>.

C, A or All: All calendar days.

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.

T, Trading: Omits all non-trading 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.

Alias: Dir, Orientation

Valid values include:

H or Horizontal: Horizontal
V or Vertical: Vertical

For example: "Dir=H"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Dir=H")

The default value is "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.

For example: "Factor=-3"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Factor=2")

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.

Valid values include:

C, P, or Previous: Imports the last available data.

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.

N, E, or Error: Returns an error message.


F: Imports the next day's value.
B or Blank: Imports a blank cell.
NA: Returns an Excel N/A error.
PNA: Imports the previous value or returns an Excel N/A error when the previous value is not available.
Any other value is used literally as a filler.

For example: "Fill=E" or "Fill=Not Available"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Fill=B")

The default value is "C".

Historical Rebase Value Override

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.

Valid values include positive or negative numbers.

For example:

For example: "Historical_Rebase_Value_Override=1000"


In a formula: =BDH("spx index","px_last","1/1/2012","1/20/2012","historical_rebase_value_override=1000")

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.

For example: "PCS=BGN" or "PCS=WMCO"


=BDH("EJ6133890 Corp", "PX LAST", "4/17/2013", "4/17/2013", "PCS=BGN")

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

The base periods are:

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.

For example: "Per=CW" or "Per=FS"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Per=CW")

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.

Valid values include positive integers.

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.

Valid values include:

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

Valid values include:

Yield or Y: When importing historical prices, historical yields are imported.


Price or P: When importing historical prices, historical prices are imported.

For example: "QtTyp=Price"


=BDH("EJ6133890 Corp", "PX LAST", "4/17/2013", "4/17/2013", "QtTyp=P")

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.

Valid values include:

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

For example: "Sort=D"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "Sort=Reverse")

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.

Valid values include:

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.

For example, "TZ=Shanghai" or "TZ=U+8".

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.

For more information on DPDF, see the DPDF Help Page.

Valid values include "Yes" (or "Y") or "No" (or "N").

For example: "UseDPDF=No"


In a formula: =BDH("IBM US EQUITY", "PX LAST", "09/14/2012", "1/31/2013", "UseDPDF=No")

When this parameter is omitted from the formula, the default value is "Yes".

BDH Examples

=BDH("AAPL US EQUITY", "PX LAST", "09/14/2012")


Imports the closing price for Apple Inc.'s equity on September 14, 2012.

=BDH("AAPL US EQUITY", "PX LAST", "-9CW","")


Imports the closing price for Apple Inc's equity at the end of each week for the past nine weeks. Each data point is
imported with its corresponding date.

=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.

=BDH("EURUSD Curncy", "PX LAST", "01/01/2012", "12/31/2012", "Dts=H", "Per=CM", "Dir=H")

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.

=BDH("EJ6133890 Corp", "PX LAST", "4/17/2013", "4/17/2013", "QtTyp=P")


Imports the closing price of the bond JGB 0.1 04/15/15 #327 on April 17, 2013. This bond is quoted in yield, but this formula
imports the price instead.

=BDH("AAPL US EQUITY", "PX HIGH", "1/1/2012", "12/31/2012", "Per=cm", "Quote=G", "Sort=D")


Imports a time series of the average daily high price of Apple Inc.'s equity within each month between January 1, 2012, and
December 31, 2012. The time series is sorted reverse chronologically, so that the most recent month appears first.

=BDH("CLA Comdty", "PX LAST", "1/1/2013", "", "per=w", "Points=5")


Imports a time series of the five most recent weeks' closing prices between January 1, 2013 and the current date for the
active WTI Crude Oil future contract.

For additional detailed examples of the BDH formula, see the BDH and BDH Relative Dates tabs on the XLTP XAPI example
spreadsheet.

41

You might also like