Skip to main content

How to use ChatGPT to write Excel formulas

A laptop opened to the ChatGPT website.
Shutterstock

Not everyone is an Excel spreadsheet expert and you may not always know how to write the formulas you need for a given data set. If you're having trouble figuring out the right formula for your data and computation needs, there's a new option that can help you write up that formula in just a few steps.

That option is ChatGPT, the buzzy, new AI chatbot from artificial intelligence company OpenAI. And among everything else ChatGPT can do, it can also write Excel formulas. In this guide, we'll show you how to use Microsoft Excel and ChatGPT together. Let's get started.

Recommended Videos

Difficulty

Easy

Duration

5 minutes

What You Need

  • Microsoft Excel

  • An OpenAI account

  • A PC

How to use ChatGPT to write Excel formulas

Let's take a look at how to use ChatGPT to write Excel formulas. For the purposes of this guide, we'll use a simple sample data set to do basic calculations (such as subtracting values) with the formulas that ChatGPT generates.

Don't forget: You'll need an OpenAI account and a Microsoft Excel spreadsheet with a data set.

Step 1: Go ahead and open the Excel spreadsheet you want to use.

In our example, we have a simple table of products, services, projected prices, and their actual prices. Using Excel formulas written by ChatGPT, we want to calculate the differences between the projected price and actual price for each product or service listed (Column D), and the subtotals of Columns B, C, and D.

Excel Spreadsheet with sample data.
screenshot

Step 2: Now open your web browser and go to the ChatGPT website. Then log into your OpenAI account. You should now see the New chat screen for ChatGPT.

ChatGPT web interface's New chat screen.
screenshot

Step 3: On the new chat screen, type in your request for an Excel formula for your data in the Send a message... text box at the bottom of the chat screen. Then press Enter on your keyboard.

In our example, we want to fill in the cells of the Differences column (Column D) with the answers from subtracting the values of the Actual Price column (Column C) from their corresponding values in the Projected Price column (Column B).

So we'll start by asking ChatGPT to write an Excel formula subtracting the number in cell C2 from the number in B2. You need to be careful in wording your request clearly and precisely as possible, otherwise, ChatGPT could misunderstand you and give you the wrong formula.

For our example we sent the following message to ChatGPT: Please write an Excel formula subtracting the value in C2 from the value in B2.

ChatGPT subtraction Excel formula request and response screenshot.
screenshot

Step 4: ChatGPT's response to your request should include a formula for you to use and a brief explanation of how to use it in an Excel spreadsheet. Copy the formula from the chat screen by highlighting it and then pressing CTRL + C on your keyboard.

Step 5: Go to your Excel spreadsheet and select the cell in which you want your formula to be. Then paste your formula into the cell by pressing CTRL + V on your keyboard. The correct answer to your formula should immediately appear in the cell you selected.

In our example, ChatGPT generated the following formula for our request: =B2-C2. And once we copy and pasted that formula into our desired spreadsheet cell (D2), the formula yielded the correct answer: The difference between Product 1's Projected Price (B2 which equals $50) and its Actual Price (C2 which equals $22) is $28.

First subtraction formula in Excel spreadsheet.
screenshot

Step 6: Then, to fill in the rest of the blank cells in the Differences column (Column D) with each product or service's correct answers, you can simply hover your cursor over the lower right corner of the cell in which you just copy and pasted your formula. Then once you see the black Plus sign icon appear, select the corner and drag your cursor to select the rest of the column until the last row of data.

Then release your hold on the cursor. Once you do, those empty cells should then automatically populate the correct answers for their respective rows of data.

Filling in the rest of the Differences column in Excel spreadsheet.
screenshot

Step 7: Let's do one more example, this time with addition. Using the same spreadsheet example, we now want to know the sum total of all the values in Column B (Projected Price).

So we'll go back to ChatGPT and send the chatbot a request for an Excel formula that adds up all of the values in column B, from B2 to B11.

In this case, our message to ChatGPT was: Please write an Excel formula that adds up all the values in Column B, from B2 to B11.

ChatGPT addition Excel formula request and response screenshot.
screenshot

Step 8: ChatGPT should respond with its formula and an explanation of how to use it. Then you should copy and paste that formula into your desired spreadsheet cell as we did for the subtraction formula earlier in this guide.

Once you paste this addition formula, the correct answer should automatically appear in that cell. For our example, ChatGPT provided this formula to add up all the cells in Column B, from B2 to B11: =SUM(B2:B11).

This formula correctly provided the answer of $5,497. This means the subtotal of the Projected Prices of the products and services listed in this spreadsheet is $5,497.

First addition in Excel spreadsheet using ChatGPT formula.
screenshot

Step 9: Lastly, since we want to fill in the rest of the data set in this spreadsheet with the subtotals of columns C and D (the actual prices and differences of all the products and services, respectively), we're going to hover our cursor over the lower right corner of the cell we just copied and pasted our addition formula into.

Once the black Plus sign icon appears, we'll select this corner and then drag it over to the right to select the next two cells. Once they're selected, release your hold.

Once you release your hold, the correct subtotal answers should appear for their respective columns of data.

Filling in the remaining subtotals in Excel spreadsheet using ChatGPT formula.
screenshot

While you can make a graph with Excel and all manner of other data analysis tasks, having the option of streamlining formulas with ChatGPT can potentially change how you use the software.

Anita George
Former Digital Trends Contributor
Anita George has been writing for Digital Trends' Computing section since 2018. So for almost six years, Anita has written…
How to jailbreak DeepSeek: get around restrictions and censorship
Phone running Deepseek on a laptop keyboard.

DeepSeek is the hot new AI chatbot that has the world abuzz for its capabilities and efficiency of operation -- it reportedly cost just a few million dollars to train, rather than the billions of OpenAI's ChatGPT and its contemporaries. But as sophisticated as DeepSeek is, it's not perfect. Like ChatGPT before it, DeepSeek can be jailbroken, allowing users to bypass content restrictions to have it talk about topics the developers would rather it didn't.

Read more
How DeepSeek flipped the tech world on its head overnight
The DeepSeek website.

DeepSeek, the chatbot made by a Chinese startup that seemingly dethroned ChatGPT, is taking the world by storm. It's currently the number one topic all over the news, and a lot has happened in the past 24 hours. Among other highlights, Nvidia's stock plummeted as a response to DeepSeek; President Donald Trump commented on the new AI; Mark Zuckerberg is assembling a team to find an answer to DeepSeek. Below, we'll cover all the latest news you need to know about DeepSeek.
Nvidia gets hit by the rise of DeepSeek

Although ChatGPT is the chatbot that quickly lost its public favorite status with the rise of DeepSeek, Nvidia is the company that suffered the greatest losses. In fact, Nvidia's market loss following the launch of DeepSeek's large language model (LLM) marks the greatest one-day stock market drop in history, says Forbes. Nvidia lost nearly $600 billion as a result of the Chinese company behind DeepSeek revealing just how cheap the new LLM is to develop in comparison to rivals from Anthropic, Meta, or OpenAI.

Read more
DeepSeek: everything you need to know about the AI that dethroned ChatGPT
robot hand in point space

A year-old startup out of China is taking the AI industry by storm after releasing a chatbot which rivals the performance of ChatGPT while using a fraction of the power, cooling, and training expense of what OpenAI, Google, and Anthropic's systems demand. Here's everything you need to know about Deepseek's V3 and R1 models and why the company could fundamentally upend America's AI ambitions.
What is DeepSeek?
DeepSeek (technically, "Hangzhou DeepSeek Artificial Intelligence Basic Technology Research Co., Ltd.") is a Chinese AI startup that was originally founded as an AI lab for its parent company, High-Flyer, in April, 2023. That May, DeepSeek was spun off into its own company (with High-Flyer remaining on as an investor) and also released its DeepSeek-V2 model. V2 offered performance on par with other leading Chinese AI firms, such as ByteDance, Tencent, and Baidu, but at a much lower operating cost.

The company followed up with the release of V3 in December 2024. V3 is a 671 billion-parameter model that reportedly took less than 2 months to train. What's more, according to a recent analysis from Jeffries, DeepSeek's “training cost of only US$5.6m (assuming $2/H800 hour rental cost). That is less than 10% of the cost of Meta’s Llama.” That's a tiny fraction of the hundreds of millions to billions of dollars that US firms like Google, Microsoft, xAI, and OpenAI have spent training their models.

Read more