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.

Your request has timed out

Your request has timed out. To prevent timeouts, go to: Extensions > GPT for Sheets > Open > GPT formulas controls > enable safe mode (line 5373).

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.

Solutions
  • Choose a model with a faster response time. You can track average response times on our response time tracker. Azure models are usually faster than OpenAI’s.

  • Use Safe mode to reduce timeouts.

  • Use GPT for Excel to completely avoid timeouts.

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 prompt or model name if it is 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 format 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 prompt if it is 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 format for temperature for your locale: 0.8 or 0,8?

Missing parameter

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

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

  • A parameter value is missing from the formula.
  • An incorrect type of value is used in the formula.
Solutions

Check that all required parameters for the function are provided. Optional parameters are shown in brackets ([ ]). For example:

  • GPT_CLASSIFY: Requires values and categories for classification.

    =GPT_CLASSIFY(value, categories, [examples], [temperature])
  • GPT_SPLIT: Requires the text to split and the delimiter used for splitting.

    =GPT_SPLIT(text, split_by, [temperature], [model])
  • GPT_FORMAT: Requires the input text and the target format.

    =GPT_FORMAT(input, target_format, [source_format], [temperature], [model])

See required parameters for each GPT function.

Unexpected parameter at the end of GPT formulas

Problem: After executing a GPT function, you notice an unexpected parameter at the end of your formula.

This happens because Safe mode is enabled. Safe mode appends a parameter to store the execution result. This allows the stored result to be reused when Google Sheets refreshes, preventing loss of results and unexpected costs.

Solution

No action required.

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. These options vary based on the model in use and your preference for a temporary or permanent solution:

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

Exceeded maximum execution time

Exceeded maximum execution time (line […]).

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