Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

RSI Google Sheets Formula: How to Use It

· 6 min read · Home Tech

In this article
  1. What Is the Relative Strength Index (RSI)?
  2. How the RSI Formula Works
  3. Step-by-Step: Building an RSI Calculator in Google Sheets
  4. Alternative: Using GOOGLEFINANCE for Live Data
  5. Choosing the Right Period and Thresholds
  6. Common Problems and How to Fix Them
  7. Comparing Google Sheets RSI to Other Tools
  8. Frequently Asked Questions

The RSI (Relative Strength Index) formula in Google Sheets is =100 - (100 / (1 + RS)), where RS is the average gain divided by the average loss over a chosen period (typically 14). To calculate it, you need a column of price changes, then apply exponential moving averages (EMA) for the gains and losses. This article explains the exact steps, the logic behind the formula, and how to build a working RSI calculator in Google Sheets.

What Is the Relative Strength Index (RSI)?

The RSI is a momentum oscillator developed by J. Welles Wilder in 1978. It measures the speed and magnitude of recent price changes to identify overbought or oversold conditions. The indicator ranges from 0 to 100. Traditionally, a reading above 70 suggests an asset may be overbought (potential pullback), while below 30 suggests oversold (potential bounce). However, these thresholds can vary depending on the asset and market context.

In Google Sheets, you can compute RSI manually using formulas, which gives you full control over the calculation method (e.g., simple vs. exponential averaging). This is useful for backtesting, custom alerts, or when you want to avoid relying on built-in chart indicators.

How the RSI Formula Works

The core formula is: RSI = 100 - (100 / (1 + RS)), where RS = Average Gain / Average Loss over the period.

  • Average Gain: The average of all positive price changes (gains) over the lookback period.
  • Average Loss: The average of all negative price changes (losses) as positive values (i.e., absolute value).

Wilder's original method uses a smoothed average (similar to an exponential moving average) rather than a simple average. In the first calculation, the average is the simple mean of the first 14 gains and losses. After that, subsequent averages are updated using: Current Avg Gain = (Previous Avg Gain * (period - 1) + Current Gain) / period, and similarly for losses. This smoothing makes the indicator more responsive to recent price action.

Step-by-Step: Building an RSI Calculator in Google Sheets

Assume you have historical price data in column A (dates) and column B (closing prices), starting at row 2. You want to calculate a 14-period RSI.

  1. Calculate price changes: In cell C3, enter =B3-B2 and drag down to the last row. This gives the daily change.
  2. Isolate gains: In cell D3, enter =IF(C3>0, C3, 0) and drag down.
  3. Isolate losses: In cell E3, enter =IF(C3<0, -C3, 0) and drag down.
  4. First average gain: In cell F17 (since you need 14 changes to start), enter =AVERAGE(D3:D16).
  5. First average loss: In cell G17, enter =AVERAGE(E3:E16).
  6. Subsequent average gain: In cell F18, enter =(F17*13 + D17)/14 and drag down.
  7. Subsequent average loss: In cell G18, enter =(G17*13 + E17)/14 and drag down.
  8. Calculate RS: In cell H17, enter =IF(G17=0, 0, F17/G17) (handles division by zero).
  9. Calculate RSI: In cell I17, enter =100 - (100 / (1 + H17)) and drag down.

For the example, if the first 14 gains average 2.5 and losses average 1.0, then RS = 2.5, and RSI = 100 - (100 / 3.5) = 71.43. This would be considered overbought.

Alternative: Using GOOGLEFINANCE for Live Data

You can pull live price data directly into Sheets using =GOOGLEFINANCE("AAPL", "close", TODAY()-30, TODAY()) to get daily closing prices for Apple over the last 30 days. Then apply the same RSI steps to that data. This makes your RSI calculator automatically update with new prices.

Note: GOOGLEFINANCE may have delays or occasional missing data, especially for cryptocurrencies or international stocks. Always verify the data range covers enough periods for your RSI calculation.

Choosing the Right Period and Thresholds

The default period is 14, but you can adjust it based on your trading style:

  • Short-term traders: Use 5 or 7 periods for more sensitivity.
  • Swing traders: Use 14 (standard).
  • Long-term investors: Use 21 or 28 for smoother signals.

Thresholds also vary: some traders use 80/20 instead of 70/30 in strong trends. In a strong uptrend, RSI can stay above 70 for extended periods, so overbought signals may be less reliable. Always combine RSI with other indicators (e.g., moving averages) for confirmation.

Common Problems and How to Fix Them

  • Division by zero: If average loss is zero (e.g., all gains), RSI is undefined. Use =IF(G17=0, 100, 100 - (100/(1+F17/G17))) to return 100.
  • Incorrect first average: Ensure you start the average exactly at the 14th change, not earlier. If you start too early, the RSI will be wrong.
  • Using simple average instead of smoothed: Some tutorials use AVERAGE for all periods, which gives a different (less smooth) RSI. Stick to Wilder's smoothing for standard RSI.
  • Missing data: If your price data has gaps (weekends, holidays), the change calculation will be based on the previous available price, which is fine, but ensure the period count is consistent.

Comparing Google Sheets RSI to Other Tools

Google Sheets gives you full transparency and customizability, but it requires manual setup. Trading platforms like TradingView or MetaTrader have built-in RSI indicators with one click. Excel also has no native RSI function, but you can replicate the same formulas. The advantage of Sheets is that you can combine RSI with other data (e.g., fundamentals) and automate alerts using Google Apps Script.

Frequently Asked Questions

Can I use the RSI formula for any asset?

Yes, RSI can be applied to any price series—stocks, forex, crypto, commodities. The formula only uses price changes, so it works universally. Just ensure you have consistent price data (e.g., daily closing prices).

Why is my RSI different from what my charting platform shows?

Differences often arise from the averaging method. Some platforms use a simple moving average for the initial calculation, while others use Wilder's smoothing. Also, some use the closing price only, while others use high/low averages. Check your platform's documentation to match the method.

How do I add RSI to a chart in Google Sheets?

You can create a line chart from the RSI column. Select the RSI data (e.g., I2:I100), go to Insert > Chart, and choose a line chart. You can also add horizontal lines at 30 and 70 using additional series with constant values.

What does RSI 50 mean?

RSI of 50 indicates that gains and losses are equal over the period—essentially no momentum. It's often seen as a neutral level. Some traders use it as a support/resistance level in trending markets.

Is RSI a leading or lagging indicator?

RSI is a lagging indicator because it uses historical price data. However, it can provide early signals of momentum changes, making it a hybrid. It's best used in conjunction with other indicators to confirm trends.

Can I automate RSI alerts in Google Sheets?

Yes, you can use Google Apps Script to send email alerts when RSI crosses a threshold. For example, write a script that checks the latest RSI value and sends an email if it's above 70 or below 30. This requires a simple trigger to run periodically.