Understanding how price changes affect customer demand is one of the most valuable insights you can bring to your business. This concept, known as price elasticity of demand, helps answer practical questions such as what happens to sales if prices increase, how much additional volume promotions really generate, and whether a company is leaving money on the table by discounting too often or not often enough.
Traditionally, analyzing elasticity required exporting data into specialized statistical tools or coding environments. That meant extra complexity and often a steep learning curve. With Python now integrated directly into Excel, and with Copilot guiding you step by step, you can perform this kind of sophisticated econometric analysis without ever leaving your spreadsheet.
In this post, we will use Copilot prompts to generate and analyze a dataset in Excel with Python, estimate the price elasticity of demand for everyday products, visualize the impact of promotions on customer demand, and summarize the business implications of the results.
To make this practical, you can follow along with the exercise file linked below. The dataset contains 200 days of simulated sales data for three products: coffee, tea, and juice. Each record includes variation in price, units sold, promotion status, and revenue. This combination of columns provides just the right balance of simplicity and analytical richness, giving us enough variation to model how price and promotions affect demand while remaining accessible even if this is your first time using Python in Excel.
Running the elasticity regression
Price elasticity of demand measures how sensitive customers are to changes in price. If demand is elastic, even a small increase in price will cause sales to fall noticeably. If demand is inelastic, customers will continue buying roughly the same amount even if prices rise. Elasticity is expressed as a number: for example, an elasticity of –1.2 means that a one percent increase in price will cause a 1.2 percent decrease in quantity sold. The negative sign reflects the usual inverse relationship between price and demand.
The most reliable way to calculate elasticity is through a regression model. Instead of simply comparing two price points, regression uses all of the available data to estimate the average relationship between price and quantity sold. A common approach is a log-log regression, where both price and sales are expressed in logarithmic terms. The beauty of this method is that the coefficient on log(price) can be interpreted directly as the elasticity. In other words, Python does the math once, and we get a clean number that tells us how responsive demand is to price.
Here’s the prompt I’ll use to get these numbers:
“Run a regression in Python to estimate the price elasticity of demand from my dataset.”

Copilot fitted the model for each product and returned elasticity estimates: Coffee at –0.074, Tea at –0.067, and Juice at –0.108. All three values are negative, as expected, confirming that higher prices lead to lower sales. The magnitude of the number tells us the degree of sensitivity. These results indicate that all three products are inelastic: for instance, raising the price of coffee by one percent would reduce sales by only about 0.07 percent. Tea is slightly less sensitive still, while juice shows the greatest responsiveness of the group.
Visualizing the relationship between price and units sold
Numbers alone can sometimes feel abstract. That’s why it’s helpful to visualize the connection between price and units sold. By plotting these two variables against each other, we can see the demand curve in action.
“Visualize the relationship between price and units sold as a scatterplot with a trendline.”

The result is a set of scatterplots, one for each product, showing the observed sales at different price points, with a fitted trendline running through the data. Each blue dot represents a day’s sales. The red line represents the overall relationship between price and units sold.
Looking at the charts, the downward slope of the trendline confirms what the regression already told us. As prices rise, sales tend to fall. For coffee and tea, the slope is very shallow, which aligns with the relatively inelastic elasticity values we saw earlier. Customers keep buying even as the price fluctuates. Juice, however, shows a more noticeable downward slope, indicating that its sales are more sensitive to price changes.
Are These Really Demand Curves?
If you’ve ever sat through an economics class, you probably remember seeing demand curves drawn as smooth, downward-sloping curves. They often look a bit exponential: sales fall gradually at first as prices rise, then more sharply as prices get very high. That shape reflects the idea that the relationship between price and quantity demanded is not perfectly straight, but curved.
So how do the scatterplots we just made fit into that picture? Strictly speaking, what you see above are empirical demand relationships, not demand curves in the textbook sense. Each dot represents a real observation from our dataset: a specific day’s price and the units sold at that price. The red line is a fitted trendline showing the overall direction of the relationship. It looks straight because we asked Python to fit a simple linear line in this plot.
Behind the scenes, though, the regression model we ran earlier was a log-log regression. That means both price and units sold were transformed into logarithmic terms before fitting the model. This approach essentially assumes that the relationship between price and demand is multiplicative, closer to the curved demand curve you might have seen in an econ diagram. The elasticity coefficient that comes out of that regression captures the slope of that curve at any point, telling us how sensitive demand is to percentage changes in price.
So while these scatterplots are extremely useful for building intuition and for communicating with a broader audience, they’re not demand curves in the pure economic sense. They’re visualizations of the actual data we have. The true “demand curve” is an abstract concept: it’s the smooth function we estimate from the regression that describes how quantity would respond to every possible price, not just the ones we happened to observe in the data.
Examining the impact of promotions
Price is not the only factor shaping demand. Promotions such as discounts, special offers, or marketing pushes can dramatically influence how much customers buy, even at the same price point. To tease apart these effects, we can ask Copilot to separate the data into two groups: sales that happened during promotions and sales that did not. Here’s the prompt I used:
“Show me how promotions shift the demand curve compared to non-promotion days.”

The resulting charts plot two sets of points for each product: blue dots represent promotion days, while orange dots represent non-promotion days. Each has its own trendline fitted through the cloud of points.
What do we see? For all three products, the promotion trendline sits higher than the non-promotion trendline. That means that at any given price, promotions are associated with higher units sold. For coffee, the gap is fairly wide, suggesting promotions provide a noticeable boost in demand. Tea shows a smaller but still consistent uplift. Juice again looks the most sensitive, with promotion days pulling sales clearly above the baseline.
Deriving business recommendations
At this point, we’ve run regressions and plotted scatterplots, but what does the elasticity number actually mean for someone making pricing decisions? To bridge that gap, I asked Copilot to summarize the results in straightforward business terms with the following prompt:
“Summarize in plain English what the elasticity estimate means for my pricing strategy.”
The key takeaway here is that your pricing strategy should be deliberate: modest adjustments can capture additional revenue with minimal risk, but aggressive changes may erode demand more sharply.
Conclusion
Elasticity analysis gives us more than just numbers; it provides a way to think strategically about pricing and promotions. There are limits, however, to what this analysis can tell us. Elasticity is an average, not a guarantee. It doesn’t capture seasonal swings, competitive pressures, or differences across customer segments.
Promotions, too, are not all created equal. The type of offer, the timing, and the marketing channel can all change their impact. And of course, our dataset was simplified for illustration. Real-world data will be messier, and interpretation will always require judgment.
The next steps for someone doing this kind of work in a business setting would be to expand beyond a single product and time frame. You might test whether elasticity looks different across categories, examine how it changes during peak versus off-peak seasons, or simulate “what if” scenarios to see how a pricing or promotion strategy could play out.
For the typical Excel user, the bigger picture is that elasticity analysis provides a structured, data-driven way to quantify customer behavior. It helps you gauge how much flexibility you have when adjusting prices or running promotions, turning raw sales data into guidance for real decisions. Approached thoughtfully, it becomes one of the most practical tools in your analytics toolkit.