Skip to main content

[GPT for Sheets] GPT function issues

Execution

Functions are stuck on "Loading"

Problem: GPT functions fail to execute and remain in a loading state.

Functions sometimes get stuck on loading for unknown reasons, it is a bug in Google Sheets/Google Apps Script, as per the official issue tracker. In most cases, functions start working again within 24 hours.

Solutions

Try the following solutions:

  • In the original spreadsheet:

    1. Execute any native formula, such as CONCAT or SUM, in an empty cell. Delete the formula when done.

    2. Delete the content of one cell containing a stuck formula and undo the deletion.

    3. Wait up to 24 hours.

  • In a new spreadsheet:

    1. Create a new blank spreadsheet.

    2. In the menu bar, select Extensions > GPT for Sheets and Docs > Enable GPT functions.

    3. To test that GPT functions work, enter =GPT("hello") in any cell and check that the formula generates a proper "hello" response.

    4. If the GPT function worked as expected, delete the formula and copy the contents of the original spreadsheet into the new spreadsheet.

    5. Disable GPT functions in the original spreadsheet. This prevents unexpected costs when the functions suddenly become unstuck, which usually happens within 24 hours.

Additional configuration required

Additional configuration required. Open the sidebar: Extensions > GPT for Sheets™ and Docs™ > Open.

This issue has two possible causes. See the table below for solutions to each:

ProblemSolution
The system cannot connect to the model provider because there is no API key or the API key provided is invalid.1. Verify that you have set an API key.
2. If your spreadsheet is on a Shared Drive, the API key must be set by the spreadsheet's Creator. For other spreadsheets, the Current Owner should set the API key. Learn more.
3. Use a model that doesn't require any API key.
GPT functions are not working if the sidebar has not been initially opened (for new users).Open the GPT for Sheets sidebar to activate your free trial. Check your permissions in the spreadsheet to ensure you can execute GPT functions.

Script error

ScriptError: Authorisation is required to perform that action.

Problem: You are likely using multiple Google accounts in the same browsing session.

Solution
  1. Create a dedicated browser profile on Google Chrome, Microsoft Edge, or Apple Safari.
  2. Create a new spreadsheet.
  3. Set up your API key in this new spreadsheet.
  4. Try a GPT function again.

Formula parsing

Invalid parameter

Error: Invalid xxx parameter.

Problem: The error indicates a formatting issue or an unreadable parameter within the formula.

Solutions

  • Check that you have quotation marks around your text if it's not in a cell:
        ✅ =GPT("hello")
        ✅ =GPT(A1)
        ❌ =GPT(hello)
  • Check that your parameters are in the correct order. See the function list.
  • Check that all parameters (even optional ones) are added as empty when there is another parameter coming after them:
        ✅ GPT_TRANSLATE(A2, "french", , "Avoid passive voice")
  • Check that you are using the right parameter separator for your locale: `,` or `;`?
  • Check that you are using the correct number formats for temperature for your locale: `0.8` or `0,8`?
  • Error: #NAME? Unknown function

    Error: #NAME? Unknown function: 'GPT'

    Problem: This error is caused by one of the following:

    • The GPT for Sheets and Docs add-on is not installed.

    • GPT functions have not been enabled in the spreadsheet.

    • Google Sheets has stopped recognizing GPT functions in the spreadsheet.

    Solutions

    Try the following solutions in order:

    1. In the menu bar, select Extensions and check for GPT for Sheets and Docs. If the add-on is not listed, install it.

    2. Enable GPT functions:

      • If you're the creator of the spreadsheet: In the menu bar, select Extensions > GPT for Sheets and Docs > Enable GPT functions.

      • If you're not the creator of the spreadsheet: Ask the creator to enable GPT functions for you, or make a copy of the spreadsheet for yourself.

    3. Reload the add-on for the spreadsheet:

      1. In the menu bar, select Extensions > Add-ons > Manage add-ons.

      2. In the list of installed apps, find GPT for Sheets and Docs and click its options button.

      3. In the options menu, unselect and select Use in this document.

    4. Try the same solutions as in Functions are stuck on "Loading".

    Formula parse error

    Formula parse error.

    Problem: Your formula contains a structural or syntax error, making it uninterpretable by Google Sheets.

    Solutions

  • Check that you have quotation marks around your text if it's not in a cell:
        ✅ =GPT("hello")
        ✅ =GPT(A1)
        ❌ =GPT(hello)
  • Check that your parameters are in the correct order. See the function list.
  • Check that all parameters (even optional ones) are added as empty when there is another parameter coming after them:
        ✅ GPT_TRANSLATE(A2, "french", , "Avoid passive voice")
  • Check that you are using the right parameter separator for your locale: `,` or `;`?
  • Check that you are using the correct number formats for temperature for your locale: `0.8` or `0,8`?
  • Missing parameter

    Error: Please set required parameter text in GPT_XXX() function

    Problem: One of the parameters in your GPT formula is required and hasn't been set.

    Solution
    Check which parameters are required for the GPT function you are using and adjust the formula as needed.

    Results

    Formulas are reloaded when I open, reload or edit the spreadsheet

    Problem: Google Sheets automatically reloads all formulas every few hours. This includes GPT formulas and can lead to unexpected costs and result changes.

    Important note: Sorting, filtering, moving columns or rows will reload ALL formulas and generate unexpected costs. Replace formulas with values before moving things around.

    Solutions

    GPT for Sheets offers a variety of options to control recalculations:

    Response is cut or incomplete

    Problem: The response you get seems to be incomplete.

    Solution

    You need to increase the cut-off limit.

    My results refreshed and I lost data

    Problem: Google Sheets automatically reloads all formulas every few hours. This includes GPT formulas and can lead to unexpected result changes.

    Solution

    Timeout

    Request timed out / Exceeded max execution time

    Your request has timed out. Select a faster model, or reduce the Max response tokens parameter if possible.

    Exceeded maximum execution time.

    Problem: Your request exceeded the 30-second limit allowed by Google Sheets functions. This is more likely to happen during peak times when the servers of the model providers (such as OpenAI) are experiencing high demand.

    The response time can vary based on the specific model you are using and the time of usage.

    Solutions

    The model you are using is very slow at the moment

    The model you are using is very slow at the moment which could result in timeouts. We canceled your executions to save you costs. Please try again with a faster model or at a later time.

    Problem: You have reached the limit of 10 timeout errors in the past minute with the same model. This is more likely to happen during peak times when the servers of the model providers (such as OpenAI) are experiencing high demand.

    The response time can vary based on the specific model you are using and the time of usage.

    Solutions