Get live Nifty put-call ratio and max pain in Excel with MarketXLS India. Connect your broker and choose the expiry whose option chain you want to analyse.
Try it in your own spreadsheet
Get the free MarketXLS sample workbook (.xlsx).
No account needed. MarketXLS live data requires a paid plan. Preview workbook
Get MarketXLS India: plans and subscription · See the India Excel add-in
Start with this formula
After connecting the required broker in the India add-in, enter:
=MXLSIN.PCR("NIFTY", 1, "oi")
Use the example as a starting point and replace its instrument, date range or cell references with your own inputs. Historical dates in examples are sample periods; expiry-specific symbols must refer to a valid contract.
Set up the worksheet
- Open Excel and install MarketXLS India from the add-in marketplace.
- Sign in with your MarketXLS India account. For broker data, connect Zerodha or Angel One using the add-in panel. Use the broker named by a broker-specific formula.
- Enter the formula in an empty area. Leave adjacent cells clear for any table or multi-cell output.
- Confirm the instrument and settings before extending the worksheet.
Put the underlying and expiry choice in labelled cells. Request PCR and max pain for that same expiry, and keep the option-chain output nearby when you need to inspect individual strikes. An expiry selector of 1 in the examples refers to the nearest expiry.
Build the working example
Label whether PCR uses open interest or volume. Open-interest PCR compares outstanding put and call contracts; volume PCR compares traded activity. Max pain is an expiry-payoff calculation across strikes, not a forecast of the settlement level.
Functions and syntax
These examples use the India namespace, MXLSIN.. Square brackets in a syntax line indicate optional arguments; do not type the brackets into Excel. Keep text arguments in quotation marks and use cell references when you want editable inputs.
PCR
Live put-call ratio for one expiry from Zerodha or Angel One: total put OI divided by total call OI (or volume).
Syntax:
MXLSIN.PCR(underlying, [expiry], [basis])
Example:
=MXLSIN.PCR("NIFTY", 1, "oi")
MaxPain
Live max pain strike for one expiry from Zerodha or Angel One: the strike where option writers pay the least at expiry.
Syntax:
MXLSIN.MaxPain(underlying, [expiry])
Example:
=MXLSIN.MaxPain("BANKNIFTY", 1)
ZerodhaOptionChain
Returns the option chain for an F&O underlying from Zerodha, optionally for a specific expiry.
Syntax:
MXLSIN.ZerodhaOptionChain(underlying, [expiry])
Example:
=MXLSIN.ZerodhaOptionChain("NIFTY")
Check the result
These functions summarize a current chain. They do not promise a historical PCR time series. A live chain can contain missing or stale observations, so check the broker session and underlying inputs before relying on changes in the summary.
If Excel reports #NAME?, confirm the India add-in is loaded and the function name is spelled correctly. If a table reports #SPILL!, clear the cells in its output area. For missing broker data, check the connection in the add-in panel, verify the symbol, and test one request before expanding the sheet. Do not replace an error with zero when zero would change your analysis.
Does high PCR mean I should buy?
No. The ratio alone does not identify whether puts were bought or written or establish the motivations behind positions. Use it as context alongside the chain, price and your own process.
Get this working in your Excel
Choose a MarketXLS India subscription, install the India add-in, and follow the steps above. The pricing page lists the current subscription options; broker access requirements are separate from the spreadsheet formulas.
Use the India function library for the complete parameter reference, or contact the India team with the formula, instrument and error message if you need setup help. Never send broker passwords or access tokens.
Continue with the India Excel workflow series for related guides.
