How to use ChatGPT to write Excel formulas: A Step-by-Step Guide
McLord A. Selasi
Interdisciplinary Creative | AI Consultant & Automation | Digital Health | Prompt Engineer| MPH Candidate | Researcher | Data Analyst| ?? I leverage AI to optimize your productivity
Excel is a powerful tool, but crafting the perfect formula can sometimes feel like deciphering an ancient code. But here comes ChatGPT, your new AI assistant for Excel mastery.
This article will walk you through leveraging ChatGPT to create formulas ranging from simple calculations to complex data manipulations.
Why Use ChatGPT for Excel Formulas?
Getting Started
The Formula Creation Process
Pro Tips for Better Results
Example Walkthrough: Garden center's monthly sales data
Here's a sample datasheet that we will use throughout this tutorial.
This dataset provides a good foundation for various formula exercises:
We'll cover basic calculations, inventory management, and advanced plant-specific analyses. Let's start then! First familiarize yourself with the data structure and entries to make your prompts specific.
1. Basic Revenue Calculation
Let's start by calculating the Total Revenue in column F.
Prompt to ChatGPT: "Create an Excel formula to calculate Total Revenue in cell F2 by multiplying Units Sold (D2) by Price per Unit (E2)."
Implement this formula in cell F2 and copy it down the column.
2. Dynamic Profit Margin Calculation
Now, let's calculate the Profit Margin in column I, assuming different margins for different plant types.
Prompt: "Create an Excel formula for cell I2 that calculates profit margin as a percentage of Total Revenue (F2). Use these rules:
Implement and test this formula.
3. Intelligent Reorder Status
For column J, we'll create a formula that suggests when to reorder based on current stock levels.
Prompt: "Create a formula for J2 that displays 'Reorder' if the remaining stock (Initial Stock minus Units Sold) is less than 20% of the Initial Stock, 'Low Stock' if it's between 20% and 40%, and 'Adequate' otherwise."
领英推荐
To input the formula: Click on cell J2, Type or paste the formula provided above, and Press Enter. Adjust thresholds if needed
4. Total Water Usage Calculation
Let's calculate the total water usage for all sold plants.
Prompt: "Create a formula to calculate the total water usage for all sold plants. Multiply the Units Sold by Water Usage for each row, then sum the results."
To input the formula: Click on the cell where you want to display the total water usage. Type or paste the formula provided above, and Press Enter.
5. Identifying Fast-Growing, High-Selling Plants
Now for a more complex analysis: identifying plants that grow quickly and sell well.
Prompt: "Create a formula that returns 'High Potential' if a plant's Growth Time is less than 60 days AND it has sold more than 30 units. Otherwise, return 'Standard'."
6. Calculating Optimal Reorder Quantity
Let's create an advanced formula for suggesting reorder quantities.
Prompt: "Create a formula to suggest a reorder quantity. Use this logic:
=IF(H2>100, 50,
IF((C2-D2)<20, 50-(C2-D2),
IF((C2-D2)<40, 30, 10)))
Add a new column for "Suggested Reorder Quantity" and apply this formula.
7. Calculating Revenue per Gallon of Water
For an environmental efficiency metric, let's calculate revenue generated per gallon of water used.
Prompt: "Create a formula to calculate revenue per gallon of water used. Divide Total Revenue by (Units Sold * Water Usage)."
ChatGPT's response:
=F2/(D2*G2)
Add a new column for this calculation.
8. Dynamic Pricing Suggestion
Finally, let's create a formula that suggests price adjustments based on sales performance.
Prompt: "Create a formula that suggests a price adjustment:
ChatGPT's response:
=ROUND(IF(D2<20, E2*0.9, IF(D2>40, E2*1.05, E2)), 2)
Add a "Suggested Price" column with this formula.
ChatGPT is a powerful ally in your Excel journey. Remember, while ChatGPT is an incredible tool, always verify critical calculations and use it as a complement to your own Excel knowledge and problem-solving skills.
Don't hesitate to ask for explanations or modifications if the initial formula doesn't meet your needs. Use ChatGPT's suggestions as a starting point, then customize and expand based on your specific requirements. Happy calculating!!!