[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.
Try the following solutions:
In the original spreadsheet:
In a new spreadsheet:
Create a new blank spreadsheet.
In the menu bar, select Extensions > GPT for Sheets and Docs > Enable GPT functions.
To test that GPT functions work, enter
=GPT("hello")
in any cell and check that the formula generates a proper "hello" response.If the GPT function worked as expected, delete the formula and copy the contents of the original spreadsheet into the new spreadsheet.
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:
Problem | Solution |
---|---|
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.
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.
- Create a dedicated browser profile on Google Chrome, Microsoft Edge, or Apple Safari.
- Create a new spreadsheet.
- Set up your API key in this new spreadsheet.
- 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.
- 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
or0,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.
Try the following solutions in order:
In the menu bar, select Extensions and check for GPT for Sheets and Docs. If the add-on is not listed, install it.
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.
Reload the add-on for the spreadsheet:
In the menu bar, select Extensions > Add-ons > Manage add-ons.
In the list of installed apps, find GPT for Sheets and Docs and click its options button.
In the options menu, unselect and select Use in this document.
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.
- 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
or0,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.
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])
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.
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:
To save results permanently and prevent formula reloading:
Replace formulas with their results automatically (currently reserved to gpt-4 and gpt-4-turbo models and the GPT_WEB function).
Replace GPT formulas with their results manually in selected cells or across an entire sheet.
To store results:
Use the cache by default most of the time.
Alternatively, use Safe mode if you also need to prevent timeouts, notably when you're expecting long generations, using OpenAI Assistants or models that are very slow like gpt-4-turbo or gpt-4.
To prevent new executions in your spreadsheet, disable GPT formulas.
Response is cut or incomplete
Problem: The response you get seems to be incomplete.
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.
You can recover your data by using the version history of your Google spreadsheet.
You can also take steps to prevent this situation from recurring.
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:
To save results permanently and prevent formula reloading:
Replace formulas with their results automatically (currently reserved to gpt-4 and gpt-4-turbo models and the GPT_WEB function).
Replace GPT formulas with their results manually in selected cells or across an entire sheet.
To store results:
Use the cache by default most of the time.
Alternatively, use Safe mode if you also need to prevent timeouts, notably when you're expecting long generations, using OpenAI Assistants or models that are very slow like gpt-4-turbo or gpt-4.
To prevent new executions in your spreadsheet, disable GPT formulas.
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.
Choose a model with a faster response time. You can track average response times on our response time tracker.
Use Safe mode to reduce timeouts.
Use GPT for Excel to completely avoid timeouts.