How Python in Excel is Revolutionizing Accounting and Finance

Data Analytics

How Python in Excel is Revolutionizing Accounting and Finance

I've had a few people reach out to me about the new Python in Excel functionality and realized there aren't many good beginner-friendly guides out there.
So I decided to write a quick tutorial for my accounting and finance friends to show why this is such a big deal.

Why This Matters

Every day on LinkedIn, I see tips about Excel: shortcuts, formulas, formatting tricks.
They're helpful, but they don't expand what Excel can fundamentally do.

After 10 years in accounting, I've seen VBA macros and hotkeys stay mostly the same.
Python in Excel is the biggest advancement in a decade—and it's a real game changer for productivity and analysis.

I was skeptical too—until I tried it.

In the past, I'd build beautiful dashboards in Jupyter, Tableau, or Power BI, only to hear:

"Can you just send it to me in Excel?"

I would painstakingly recreate everything.
Now, with Python in Excel, I can keep the power of advanced analysis inside Excel without dumbing it down.

Example: Football Time Series Analysis

Let's walk through a simple but powerful example to show how easy it is.

Step 1: Finding Some Data

One big forecasting challenge is understanding seasonality—how different times of the year affect trends like sales or interest.

Example: Football interest peaks in the fall and drops off in spring.

A great free tool for this is Google Trends: https://trends.google.com
Search for "Football" and download 5 years of data.

Step 2: Basic Data Cleaning in Excel

In Excel:

  1. Highlight the downloaded table (Ctrl+A)
  2. Turn it into an official table (Ctrl+T)
  3. Rename the table to something easy like data (under Table Design)

Also, simplify the column headers:

  • Rename "football: (United States)" to interest
  • Rename Week to week

Step 3: Getting Started with Python in Excel

In Excel O365:

  • Insert a Python cell using the Formulas tab
  • Or simply type =PY(...)

Your cell will turn green, meaning you're in Python mode.

To load your Excel table into Python:

df = xl("data[#All]", headers=True)

This creates a DataFrame, like a supercharged named range in Excel.

Step 4: Inspecting Your Data

Check your data by typing:

df.info()

You can also run:

df.describe()

to quickly see high-level statistics.

To plot your data:

df.plot()

or

df['interest'].plot()

Step 5: Real Analysis with Seasonality

Now for the magic: Seasonal Decomposition

from statsmodels.tsa.seasonal import seasonal_decompose
 
result = seasonal_decompose(df.interest, model='additive', period=52)
result.plot()

This generates a four-part chart:

  • Original data
  • Trend line
  • Seasonality patterns
  • Residuals (random noise)

How to Read It

  • Trend: Shows general interest direction (up/down)
  • Seasonality: Repeating yearly patterns (peaks in fall, dips in spring)
  • Residuals: Random fluctuations or anomalies

This kind of data decomposition is critical for:

  • Budget planning
  • Ad campaign timing
  • Long-term forecasting

Why This Is Powerful

Instead of guessing from messy charts, you now have real, actionable insights.

You can:

  • Budget based on real seasonal behavior
  • Spot trends early
  • Move from gut-feel decisions to data-driven ones

And the best part?
No setup, no complicated environments. Just Excel.

Final Thoughts

Python in Excel might look like a small feature, but it fundamentally changes how we work with data.

For years, the cycle was: pivot tables to helper columns to a little VBA to export.
Now you can do real-time statistical analysis, modeling, and visualization without ever leaving Excel.

What's Next?

If you're new to Python:

  • Start simple: load data, run describe(), plot a few trends.
  • Build up slowly.

The power is right there—and it's easier to use than ever.

(If you'd like a full downloadable Excel workbook with this example already built, let me know!)