5 Tips & Tricks for Using OpenAI in Spreadsheet.com

Introduction to OpenAI and GPT

OpenAI is an artificial intelligence (AI) research laboratory dedicated to AI technology. Most famously, OpenAI has developed the ChatGPT AI chatbot on top of its OpenAI API to automatically generate human-like text and image content in response to user input.

The OpenAI API is a set of tools and services that allow developers to build applications powered by AI. It provides access to a range of AI services, including natural language processing, computer vision, and more.

OpenAI in Spreadsheet.com

With our native OpenAI integration, you have fast and easy access to the power of OpenAI’s models inside your spreadsheets. This allows you to write simple formulas to accomplish a virtually endless number of possible tasks.

In order to use OpenAI to its full potential, it may take some time for you to learn how to format requests and “talk” to the models properly. You may also run into some quirks along the way. Whether it’s your first time working with OpenAI or you’re a seasoned pro, read through these tips and tricks to get the most out of Spreadsheet.com’s OpenAI integration.

1. Use CONCATENATE to Create Complex Requests

Using the CONCATENATE function nested inside of the OPENAI_COMPLETE function allows you to create complex requests with a combination of text, cell, and range references, all in a single prompt argument.

A simple request without any cell references can be accomplished without a nested function, like:

=OPENAI_COMPLETE(“What state is Los Angeles in?”)

If you were to include the city name as a cell reference instead of including it explicitly, you could use a CONCATENATE helper function like:

=OPENAI_COMPLETE(CONCATENATE(“What state is “,A1,” in?”))

You can use CONCATENATE to reference multiple cells within one OPENAI_COMPLETE prompt argument, like:

=OPENAI_COMPLETE(CONCATENATE(“Generate a list of “,A1,” keywords about “,B1,” each with a maximum character length of “,C1))

Take a look at our OpenAI Completions workbook to see these types of nested CONCATENATE functions in action, and review the function documentation for CONCATENATE to learn more about joining text strings.

2. Adjust Your Prompts for Different Results

Sometimes, the output of your OpenAI request doesn’t match your expectations. Try adjusting your prompt argument to reword your query or include more specific language.

Try adjusting your OpenAI request until you get the answer you're looking for

If you drag an OpenAI formula down through an entire column, it may not always return the request in the same format for every row, and you may need to adjust your formula on a per-cell basis.

3. Be Patient

Depending on the length and complexity of your request, it may take a while for OpenAI to generate a response. This is especially true if you take a formula from one cell and drag it down through a column, or if you use the OPENAI_COMPLETE function with the Column Formula data type.

When OpenAI is “thinking” and generating a response, the cell will show an ellipse (...). If you encounter a #TIMEOUT! error, try adjusting your request and re-running the formula.

4. Be Careful with Your Token Usage

When you use OpenAI integration functions, each request and its associated output uses “tokens”, and your OpenAI account is billed based on the number of tokens you use each month. Learn how token usage is calculated in OpenAI’s Help Center.

As you build workbooks with OpenAI functions, keep an eye on your token usage and billing information from your OpenAI account. If your OpenAI functions are not working as expected, check your OpenAI account settings to make sure you have not hit your token limit.

Note: Take extra precaution when using the OpenAI integration formulas with the Column Formula data type. If you apply a function to a worksheet with hundreds or thousands of rows, you could easily use more tokens than expected.

5. Check the Facts

OpenAI models are trained using deep learning, based on a large corpus of text gathered from the internet and other sources. Like all AI models, OpenAI’s models are only as accurate as the information that they’re trained on.

OpenAI results are often high-quality accurate answers, but make sure you double-check and research results instead of taking them as fact. Take extra precaution when using OpenAI to generate something like a financial recommendation or investment decision.

When you use an OpenAI integration function, Spreadsheet.com sends your request to OpenAI and returns the output that OpenAI generates. Spreadsheet.com is not generating the responses themselves, and is not responsible for the accuracy – or lack thereof – of OpenAI integration function outputs.

Learn More about Working with OpenAI

With Spreadsheet.com’s OpenAI integration functions, the ways in which you can use artificial intelligence to enhance your workbooks are endless. Take a closer look at how to work with OpenAI in our Help Center, or visit the documentation for the OPENAI_COMPLETE function. Check out our companion guide "10 Ways to Use OpenAI Completions in Spreadsheet.com" to see OpenAI integration functions in action.

Sign up — it's free