Black Friday sale on now: up to 44% off annual plans Shop the sale →
← All articles
OptionsInvesting & AnalysisBacktesting

How to Calculate Max Pain in Google Sheets and Excel

Calculate options max pain for any US stock or ETF in Google Sheets and Excel from live open interest, chart the pain curve, check a whole watchlist with one formula per row, and test whether past expirations actually settled near it.

Max pain is the strike price at which all the open calls and puts on one expiration would be worth the least if the stock closed there. Option holders as a group would collect the smallest payout at that price, which is where the name comes from. You can calculate it in Google Sheets or Microsoft Excel from the open interest at every strike, which SF_OPTIONS() returns in one formula.

This guide builds a max pain calculator you can point at any optionable US stock or ETF, charts the pain curve, puts a whole watchlist on one sheet with a one-cell formula, and then tests the theory: did past expirations actually settle near their max pain, and how did max pain move in the days before expiry?

Every screenshot in this guide comes from the free SF Max Pain Calculator template for Google Sheets or Excel, and every cell reference matches it. Copy the template to skip the setup, or build it yourself from the steps below.

Start a 15-day free trial of SheetsFinance Options (no payment details required) to reproduce every example in this guide. The current-chain examples use SF_OPTIONS(), which is part of Options Standard. The backtest and the path into expiry in sections 5 and 6 use historical chains from SF_OPTIONS_PRO(), which is part of Options Pro. The trial includes Options Pro with 500 options calls a day.

What You Can Build

By the end of this guide you will be able to:

  • Pull open interest for every strike on any expiration
  • Calculate the max pain strike and the total payout at every possible closing price
  • Chart the pain curve around the current price
  • Calculate max pain for a whole watchlist with one formula per row
  • Check where past expirations closed compared with their max pain a week earlier
  • Track how max pain moved each day into an expiration

How Max Pain Is Calculated

Max pain only needs one input: the open interest (the number of contracts still open) for every call and put on one expiration. Prices, volume and implied volatility play no part.

For each strike, pretend the stock closes exactly there at expiration, and add up what every option would pay its holder:

  • every call with a lower strike pays the closing price minus its strike;
  • every put with a higher strike pays its strike minus the closing price;
  • multiply each payout by its open interest and by 100 shares per contract.

The strike with the smallest total is max pain. Here is a simple example with three strikes:

Strike Call open interest Put open interest If the stock closes here, calls pay Puts pay Total
$90 100 50 $0 $1,000,000 $1,000,000
$100 350 200 $100,000 $400,000 $500,000
$110 50 400 $550,000 $0 $550,000

At a $100 close, the 100 calls at $90 pay $10 each and the 400 puts at $110 pay $10 each: (100 × $10 + 400 × $10) × 100 = $500,000. That is the lowest total, so max pain is $100.

Notice that max pain is not simply the strike with the most open interest. It depends on the whole chain, so a real calculation has to include every strike on the expiration.

The theory. Max pain theory says a stock tends to drift towards this strike as expiration approaches, because of how the dealers who sold the options hedge them. The calculation is plain arithmetic; the theory is debated. Section 5 shows how to test it on the stocks you follow.

The Syntax

SF_OPTIONS() returns the current options chain for one expiration:

Copy
=SF_OPTIONS(symbol, type, metrics, expirationDate, options)
  • symbol is the underlying ticker, such as "AAPL" or "SPY", or a cell holding it.
  • type is "calls", "puts" or "calls&puts". For max pain, use "calls&puts": it lists every call, then every put.
  • metrics picks the columns. Max pain needs "strike&type&openInterest".
  • expirationDate is the expiration in YYYY-MM-DD format or a date cell. If the date is not an expiration, you get the next one after it. List the available dates with =SF_OPTIONS("AAPL","expirationDates").
  • options accepts "NH" (no header row) and "range=ntm10", "range=ntm20" or "range=ntm50" to keep only the strikes nearest the money.

Chains are 15-minute delayed, and open interest is updated once a day, so max pain changes from one day to the next. The formulas are the same in Google Sheets and Excel.

1. Pull Open Interest by Strike

Put this formula in A1 to see the open interest around the current price for Apple's 18 December 2026 expiration:

Copy
=SF_OPTIONS("AAPL","calls&puts","strike&type&openInterest","2026-12-18","range=ntm10")
Spreadsheet listing Apple's 18 December 2026 call and put strikes near the money with the open interest on each

range=ntm10 keeps the 10 strikes either side of the money, which is easier to read. Leave it off when you calculate max pain. Contracts far from the money still pay out at most closing prices, so trimming the chain changes the answer.

On the 27 November 2026 close, the strike with the most put open interest on this expiration was $300 (50,635 contracts), and the most call open interest was at $360 (41,796 contracts). Max pain is not either of those, as the next step shows.

2. Build a Max Pain Calculator

The calculator uses two tabs: Max Pain for the inputs and results, and Chain for the full chain and the payout at every strike. Name your tabs the same way so the formulas below work as they are.

Cell Holds Formula
Max Pain!B4 Ticker AAPL
Max Pain!B5 Expiration 2026-12-18 (a date)
Chain!A1 The full chain =SF_OPTIONS('Max Pain'!$B$4,"calls&puts","strike&type&openInterest",'Max Pain'!$B$5)
Chain!E2 Every strike, once =SORT(UNIQUE(FILTER($A$2:$A$1500,ISNUMBER($A$2:$A$1500))))
Chain!F2 Total payout if the stock closes at E2 The formula below, filled down to F600
Max Pain!A8 Max pain =IFERROR(INDEX(Chain!$E$2:$E$600,MATCH(MIN(Chain!$F$2:$F$600),Chain!$F$2:$F$600,0)),"-")
Max Pain!C8 Stock price =SF($B$4)
Max Pain!E8 Max pain vs price =IF(AND(ISNUMBER(A8),ISNUMBER(C8)),A8/C8-1,"-")

The chain in Chain!A1 prints a header row (Strike, Type, Open Interest) and then one row per contract from row 2. E2 lists each strike once, smallest first. Put headers in E1 and F1, then enter this in F2 and fill it down to F600:

Copy
=IF(E2="","",100*(SUMPRODUCT(($B$2:$B$1500="call")*$C$2:$C$1500*(E2>$A$2:$A$1500)*(E2-$A$2:$A$1500))+SUMPRODUCT(($B$2:$B$1500="put")*$C$2:$C$1500*($A$2:$A$1500>E2)*($A$2:$A$1500-E2))))

The first SUMPRODUCT adds up every call below the closing price in E2, and the second every put above it. (E2>$A$2:$A$1500) is 1 for the strikes that pay and 0 for the rest, so out-of-the-money contracts drop out. Max Pain!A8 then picks the strike with the smallest total.

The template adds two more results in the same row: the put/call open interest ratio in G8, =IFERROR(SUMIF(Chain!$B$2:$B$1500,"put",Chain!$C$2:$C$1500)/SUMIF(Chain!$B$2:$B$1500,"call",Chain!$C$2:$C$1500),"-"), and the payout at max pain in I8, =IF(COUNT(Chain!$F$2:$F$600)=0,"-",MIN(Chain!$F$2:$F$600)).

SF Max Pain Calculator dashboard for Apple's 18 December 2026 expiration showing a max pain of $320, a stock price of $358.54, max pain 10.7% below the price, a put/call open interest ratio of 1.03 and a payout at max pain of $1,243.6 million

On the 27 November 2026 close, with Apple at $358.54, max pain for the 18 December expiration was $320, 10.7% below the share price. If Apple closed at $320 on 18 December, the open options on that expiration would pay their holders about $1.24 billion in total, less than at any other strike. Put and call open interest were almost level, at 1.03 puts for every call.

Change B4 to another ticker or B5 to another expiration and both tabs recalculate. A chain for SPY or QQQ has roughly 500 to 700 contracts on a monthly expiration, which still fits inside the ranges above.

3. Chart the Pain Curve

A chart shows how sharp or flat the minimum is. The template charts the 21 strikes around max pain, so the chart follows whatever ticker and expiration you enter. On the Max Pain tab:

  • B31 finds the first of the 21 strikes, 10 rows above max pain in the strike list: =IFERROR(MAX(1,MIN(MATCH(A8,Chain!$E$2:$E$600,0)-10,COUNT(Chain!$E$2:$E$600)-20)),1)
  • A33 holds the first strike: =IFERROR(INDEX(Chain!$E$2:$E$600,$B$31+0)&"",""). A34 uses $B$31+1, and so on down to $B$31+20 in A53.
  • B33 holds its payout: =IFERROR(INDEX(Chain!$F$2:$F$600,$B$31+0),""), with the same +1 to +20 steps down to B53.

&"" turns each strike into text, so the chart uses the strikes as labels instead of plotting them as a second series. Put headers in A32 and B32, select A32:B53 and choose Insert → Chart → Column chart. Format the Y-axis as currency in millions ($#,##0,,"M").

Column chart of the total payout to Apple option holders at the 21 strikes from $270 to $345 for the 18 December 2026 expiration, lowest at $320, next to a table of the ten strikes with the most open interest

Apple's curve has a broad, flat bottom: the total payout is within 1% of the minimum from $315 to $322.50. It climbs faster to the right of the minimum than to the left: $25 either side of $320, the total is about $1.50 billion at $345 and $1.42 billion at $295. A flat bottom means a small change in open interest can move max pain by a strike or two, so read it as a zone rather than an exact price.

The table beside the chart lists the ten strikes with the most open interest. The $300 strike leads with 72,039 contracts, mostly puts, yet max pain sits at $320, a reminder that the answer depends on the whole chain.

4. Calculate Max Pain for a Watchlist in One Cell

The calculator needs a helper table for each stock. To check several stocks at once, wrap the whole calculation in one formula with LET and MAP. On the Watchlist tab, put the expiration date in B4, headers in row 6 and tickers in A7:A16, then enter:

  • B7: =SF($A7)
  • C7: the formula below, which fills C7 and D7
  • E7: =IF(AND(ISNUMBER(B7),ISNUMBER(C7)),C7/B7-1,"")
Copy
=IF($A7="","",IFERROR(LET(c,SF_OPTIONS($A7,"calls&puts","strike&type&openInterest",$B$4,"NH"),s,INDEX(c,0,1),t,INDEX(c,0,2),oi,INDEX(c,0,3),k,UNIQUE(s),pain,MAP(k,LAMBDA(x,SUMPRODUCT(oi*(t="call")*(x>s)*(x-s))+SUMPRODUCT(oi*(t="put")*(s>x)*(s-x)))),co,SUMPRODUCT(oi*(t="call")),po,SUMPRODUCT(oi*(t="put")),HSTACK(XLOOKUP(MIN(pain),pain,k),IF(co=0,"-",po/co))),"No chain"))

Fill B7:E7 down to row 16. Format B:C as currency, D as a number with two decimals and E as a percentage.

LET names each column of the chain (s strikes, t types, oi open interest), MAP runs the payout calculation for every strike k, and XLOOKUP returns the strike with the smallest total. HSTACK puts the put/call open interest ratio beside it in column D. The 100-share multiplier is left out because it doesn't change which strike is lowest. It returns the same result as the calculator: $320 for Apple on 18 December.

Max Pain Watchlist of ten stocks and ETFs showing each price, the max pain strike for the 18 December 2026 expiration, the put/call open interest ratio and how far max pain is from the price
Symbol Close, 27 Nov 2026 Max pain, 18 Dec Put/call OI Max pain vs price
AAPL$358.54$3201.03-10.7%
SPY$728.32$7351.67+0.9%
QQQ$650.99$6701.00+2.9%
NVDA$150.49$1620.83+7.6%
TSLA$400.00$3550.87-11.3%
MSFT$492.85$4750.38-3.6%
AMZN$254.12$2400.75-5.6%
META$628.96$6200.45-1.4%
GOOGL$274.96$2900.64+5.5%
AMD$424.54$3900.90-8.1%

This snapshot came after a sharp sell-off and a quick rebound. SPY fell 8.6% in the week to 20 November and then rose 5.6% in the holiday-shortened week to 27 November, and Nvidia rose 20% after its board reinstated Jensen Huang as chief executive. Max pain barely moved while prices swung: SPY's max pain for 18 December was $740 on 20 November and $735 a week later, so the gap between price and max pain shrank from +7.3% to +0.9% because the price came back, not because max pain followed it. That is a reminder that max pain describes where positions sit, not where the price has to go.

The one-cell formula needs LET, MAP, LAMBDA and HSTACK. They work in Google Sheets, Excel for Microsoft 365, Excel for the web and Excel 2024. The calculator in section 2 works in Excel 2021 as well. Each row uses one options call per refresh.

5. Test the Theory on Past Expirations

Does a stock really drift towards max pain? With Options Pro you can check. SF_OPTIONS_PRO() returns the chain as it stood on a past trade date, including expired contracts, so you can calculate max pain a few days before each expiration and compare it with where the stock actually closed.

The template's Backtest tab takes four inputs: the ticker in B4, the latest expiration month in B5, how many trading days before each expiration to take the snapshot in B6 (5 is one week), and the band that counts as "near" max pain in B7 (2%). Rows 15 to 38 then cover the last 24 monthly expirations:

  • A15 (the monthly expiration, the third Friday or the Thursday before it when Friday is a market holiday): =LET(m,EDATE(DATE(YEAR($B$5),MONTH($B$5),1),-(ROW()-15)),f,m+MOD(6-WEEKDAY(m),7)+14,WORKDAY(f+1,-1,Notes!$A$6:$A$80))
  • B15 (the snapshot date): =WORKDAY(A15,-$B$6,Notes!$A$6:$A$80)
  • C15 (max pain on the snapshot date): =IF(A15>=TODAY(),"Not expired",IFERROR(LET(c,SF_OPTIONS_PRO($B$4,"calls&puts",A15,"",B15,"","strike&type&openInterest","NH"),s,INDEX(c,0,1),t,INDEX(c,0,2),oi,INDEX(c,0,3),k,UNIQUE(s),pain,MAP(k,LAMBDA(x,SUMPRODUCT(oi*(t="call")*(x>s)*(x-s))+SUMPRODUCT(oi*(t="put")*(s>x)*(s-x)))),XLOOKUP(MIN(pain),pain,k)),"Needs Options Pro"))
  • D15 (close on the snapshot date): =IF(B15>=TODAY(),"",IFERROR(SF_TIMESERIES($B$4,B15,B15,"daily","close","NH"),""))
  • E15 (close on the expiration date): =IF(A15>=TODAY(),"",IFERROR(SF_TIMESERIES($B$4,A15,A15,"daily","close","NH"),""))
  • F15 (gap at expiration): =IF(AND(ISNUMBER(C15),ISNUMBER(E15)),E15-C15,"")
  • G15 (did the price move closer?): =IF(AND(ISNUMBER(F15),ISNUMBER(D15)),IF(ABS(E15-C15)<ABS(D15-C15),"Yes","No"),"")
  • H15 (gap as a share of the close): =IF(ISNUMBER(F15),ABS(F15)/E15,"")
  • I15 (closed near max pain?): =IF(ISNUMBER(H15),IF(H15<=$B$7,"Yes","No"),"")

Fill A15:I15 down to row 38. Notes!A6:A80 holds the NYSE holidays, so WORKDAY skips them. The scorecard above the table counts the results: for example, "Moved closer" is =IF(COUNT(F15:F38)=0,"-",COUNTIF(G15:G38,"Yes")/COUNT(F15:F38)).

Max Pain Backtest for Apple's 24 monthly expirations from December 2024 to November 2026, with a scorecard showing the price moved closer to max pain in 29% of them, closed within 2% of it in 13% and finished an average of 7.1% away

For Apple's 24 monthly expirations from December 2024 to November 2026, the stock closed above its max pain from a week earlier in 22 of them and finished an average of 7.1% away from it. It moved closer to max pain over that final week in 7 of the 24 (29%) and finished within 2% of it only 3 times (13%). In November, Apple fell from $356.27 to $342.56 as the market sold off, finishing $7.56 above its $335 max pain.

SPY's 20 November expiration makes the same point more sharply. A week before, SPY closed at $754.37 with max pain at $758, almost on top of the price. It then fell 8.6% in a week and expired at $689.81, $68 below.

Two years of one stock is still a small sample, and a strong trend can overwhelm any pull from hedging: Apple rose about 35% over these two years, and max pain trailed below the price. Research on the idea is mixed: some studies find prices cluster near option strikes on expiration day, but none shows max pain predicting the close reliably. Change B4 to the tickers you trade before you rely on it.

6. Track Max Pain into Expiry

The backtest takes one snapshot per expiration. The template's Path tab shows how max pain moved each day over the last 10 trading days before one expiration, again with Options Pro. Put the ticker in B4 and a past expiration in B5, headers in row 12, then enter:

  • A13 (trade date, ten trading days before expiry): =WORKDAY($B$5,-(23-ROW()),Notes!$A$6:$A$80)
  • B13 (max pain on that date): =IF(A13>TODAY(),"",IFERROR(LET(c,SF_OPTIONS_PRO($B$4,"calls&puts",$B$5,"",A13,"","strike&type&openInterest","NH"),s,INDEX(c,0,1),t,INDEX(c,0,2),oi,INDEX(c,0,3),k,UNIQUE(s),pain,MAP(k,LAMBDA(x,SUMPRODUCT(oi*(t="call")*(x>s)*(x-s))+SUMPRODUCT(oi*(t="put")*(s>x)*(s-x)))),XLOOKUP(MIN(pain),pain,k)),"Needs Options Pro"))
  • C13 (close on that date): =IF(A13>=TODAY(),"",IFERROR(SF_TIMESERIES($B$4,A13,A13,"daily","close","NH"),""))
  • D13 (close minus max pain): =IF(AND(ISNUMBER(B13),ISNUMBER(C13)),C13-B13,"")

Fill A13:D13 down to row 23, so row 23 is the expiration day, and chart D13:D23 as columns.

Max Pain Path into Expiry for Apple's 20 November 2026 expiration, showing daily max pain rising from $330 to $340 over the last 10 trading days while the close fell back to $342.56, with a column chart of the gap shrinking to $2.56

Into Apple's 20 November expiration, max pain rose from $330 to $340 over the last 10 trading days as open interest shifted to higher strikes, while the stock peaked at $356.27 on 13 November and then fell to $342.56 on expiration day. The gap closed from $25.63 on 11 November to $2.56 at expiry. Both moved: max pain rose towards the price, and the price fell towards max pain, so a narrowing gap on its own doesn't show that the price was pulled.

Common Mistakes to Avoid

  • Trimming the chain: range=ntm10 and similar options drop strikes that still pay out. Use the full chain for max pain. Some websites count only the strikes near the price, so their max pain can differ by a strike or two from the full-chain figure.
  • Reading the biggest open interest as max pain: The answer depends on every strike's open interest and distance from each closing price, not on the single biggest position.
  • Mixing expirations: Each expiration has its own max pain. Weekly and monthly expirations on the same stock can be far apart.
  • Using stale open interest: Open interest updates once a day. Recalculate the morning of the day you use it.
  • Treating it as a price target: Max pain says where option holders collect the least, not where the stock will close. News, earnings and market moves regularly overwhelm it.
  • Counting from the first data row: The chain in Chain!A1 has a header row, so the data starts in row 2. Use "NH" when a formula sits under your own headings.
  • Passing a past expiration to SF_OPTIONS(): Expired chains are part of SF_OPTIONS_PRO(), which needs Options Pro.

Frequently Asked Questions

What is max pain in options?

Max pain is the strike price at which all the open calls and puts on one expiration would pay their holders the smallest total amount if the stock closed there. It is calculated from open interest alone.

How do I calculate max pain in Excel?

Pull the chain with =SF_OPTIONS("AAPL","calls&puts","strike&type&openInterest","2026-12-18"), then for each strike add up what the in-the-money calls and puts would pay, using SUMPRODUCT. The strike with the smallest total is max pain. Section 2 has the full calculator, and section 4 has a one-cell version.

Does max pain work in Google Sheets?

Yes. SF_OPTIONS() and every formula in this guide work the same way in Google Sheets.

How do I find SPY's max pain?

Put SPY in B4 of the Max Pain tab and the expiration you want in B5. SPY has an expiration every weekday, so check the date first with =SF_OPTIONS("SPY","expirationDates"). The template lists the expirations for the ticker in B4 in column K of its Chain tab.

Is max pain accurate?

As a calculation from open interest it is exact. As a forecast of the closing price, there is no agreed hit rate. Use the backtest in section 5 to see how it has done on the stocks you follow.

Which plan do I need?

Current chains, and everything in sections 1 to 4, use SF_OPTIONS(), which is part of Options Standard. The backtest and the path into expiry in sections 5 and 6 need historical chains from SF_OPTIONS_PRO(), which is part of Options Pro. Without it, those tabs in the template show "Needs Options Pro" and the rest keeps working. The 15-day Options trial includes Options Pro with 500 options calls a day.

Put Max Pain on Your Expiration Watchlist

Copy the SF Max Pain Calculator template, or build the calculator for one stock you trade, then add the watchlist for the expirations you care about and keep the backtest beside it so you can see how each stock has behaved before. Every formula takes a cell reference, so the same sheet works for any optionable US stock or ETF.

Read the Options Standard, Chains & Contracts and Historical Chains references, or start a 15-day Options trial to build it in Google Sheets or Excel. For more on pulling chains, Greeks and implied volatility, see How to Get Options Data in Google Sheets and Excel. To test strategies across years of past chains, continue with How to Get Historical Options Data for Backtesting.

David Marcuson
Founder