Nifty Spread and Straddle Calculator in Excel

In this article

Compare a Nifty spread and straddle in Excel with MarketXLS India's payoff functions. Build each strategy as a separate leg table and calculate its expiry results.

See it in actionMarketXLS video
View current plans

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

Nifty Spread and Straddle Calculator in Excel - MarketXLS

Get MarketXLS India: plans and subscription · See the India Excel add-in

Start with this formula

After creating the leg table below, enter this in an empty area:

=MXLSIN.Payoff(A2:E3)

Payoff uses your worksheet inputs rather than a broker session. Create the leg table described below before entering the formula.

Set up the worksheet

  1. Open Excel and install MarketXLS India from the add-in marketplace.
  2. 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.
  3. Enter the formula in an empty area. Leave adjacent cells clear for any table or multi-cell output.
  4. Confirm the instrument and settings before extending the worksheet.

For a call debit spread, enter a long call at the lower strike and a short call at the higher strike. For a long straddle, enter a long call and a long put at the same strike. Keep expiry and quantity assumptions consistent and use separate output ranges.

Build the working example

Use illustrative straddle premiums of 150 for the call and 130 for the put at strike 24000, with one unit of each. The total premium is 280 and the expiry breakevens are 23720 and 24280 before costs. Compare that with the limited profit and limited loss of a debit spread using its own premiums.

Enter these illustrative legs in A1:E3 (row 1 contains headers):

TypeStrikePremiumQtyLot size
CE2400015011
CE2420070-11

This table models the debit call spread. For a straddle, use a CE and PE at the same strike with positive quantities.

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.

Payoff

Expiry P&L of a multi-leg option or futures strategy across a range of underlying prices. No broker connection needed.

Syntax:

MXLSIN.Payoff(legs, [priceFrom], [priceTo], [steps])

Example:

=MXLSIN.Payoff(A2:E3)

Payoff_Summary

Max profit, max loss, breakevens and net premium of a multi-leg strategy at expiry. No broker connection needed.

Syntax:

MXLSIN.Payoff_Summary(legs)

Example:

=MXLSIN.Payoff_Summary(A2:E3)

Check the result

Live option premiums change the inputs, but the output remains an expiry payoff. A short straddle has a different risk profile from a long straddle; changing the signs of quantities changes the position, not merely the presentation.

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.

Can I model more than two legs?

Yes. Give each leg its own row and pass the complete range to the payoff functions. Check the leg signs and actual lot size before interpreting total rupee amounts.

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.

About the authors
Robin

About Robin

Co-Founder & COO, MarketXLS

Robin is a co-founder and the COO of MarketXLS. He works with Ankur and Anagh on the MarketXLS blog, creating articles together about market data and spreadsheet workflows.

Written collaboratively by Robin, Ankur and Anagh.

Important Disclaimer

The information provided in this article is for educational and informational purposes only and should not be construed as investment advice, a recommendation, or an offer to buy or sell any securities. MarketXLS is a financial data platform and is not a registered investment advisor, broker-dealer, or financial planner. Always conduct your own research and consult with a qualified financial professional before making any investment decisions. Past performance is not indicative of future results. Trading and investing involve substantial risk of loss.

See MarketXLS in action

Bring this workflow into Excel.

Book a demo with our team to see how MarketXLS supports your market research.

Ankur
AnkurFounder & CEO, MarketXLS