Stop Copy-Pasting: How to Automate Your Weekly Reports with Power Query and Python
If you spend hours every week copying data between spreadsheets to build the same report, there is a better way. Here is how Power Query and a few lines of Python can turn that chore into a one-click job.

It's Monday morning. Before you can do anything useful, you have to build "the report". You download sales exports from three branches, open each file, copy the data into a master spreadsheet, fix the dates that came through as text, delete the duplicate rows, update the pivot table, and paste the totals into an email for management. Two hours later, you finally start your actual work.
Next Monday, you'll do it all again. And the Monday after that.
If that sounds familiar, you're in good company. Manual reporting quietly eats up an enormous amount of time in offices everywhere. It's also where mistakes creep in: a missed row, a wrong formula, a file from last week instead of this week. The good news is that most of it can be automated with tools you may already have, and you don't need to become a full-time programmer to do it.
Why Manual Reports Are a Problem
- They waste skilled time. People who understand the business spend hours doing work a computer could do in seconds.
- They introduce errors. Every copy and paste is a chance for something to go wrong.
- They depend on one person. When the "report person" is on leave, the report often doesn't happen.
- They're slow. By the time the report reaches decision-makers, the numbers can already be out of date.
Option 1: Power Query (No Coding Required)
If you use Excel or Power BI, you already have one of the most underrated tools in business: Power Query. In Excel, you'll find it under the Data tab as Get & Transform Data.
Power Query lets you connect to data sources, clean and reshape the data, and save every step you took. The next time you need the report, you click Refresh and it repeats all those steps automatically on the new data.
A typical Power Query workflow
- Put all your export files in one folder. For example, a shared folder called Weekly Sales.
- In Excel, go to Data → Get Data → From File → From Folder and select that folder.
- Combine the files. Power Query stacks the data from every file into a single table, as long as the columns match.
- Clean the data: set correct data types for dates and numbers, remove empty rows, trim extra spaces, remove duplicates and rename columns. Each action is recorded as a step.
- Load the result into a table or straight into a pivot table or chart.
- Next week, drop the new files into the folder and click Refresh All. Done.
For many teams, this alone turns a two-hour job into a two-minute one. And because the steps are visible, someone else can understand and maintain the process.
When Power Query is enough
Power Query is ideal when your data lives in Excel files, CSVs, SharePoint, databases or common online sources, and when someone is happy to open Excel and press Refresh. It struggles with very large datasets, highly custom logic, or reports that need to run completely unattended.
Option 2: Python (A Little Code, a Lot of Power)
Python has become the go-to language for data work, and the pandas library makes spreadsheet-style tasks remarkably simple. You don't need to master programming to automate a report. A short script can often replace hours of manual work.
Here's a simple example that combines all the Excel files in a folder, cleans them, and produces a summary by branch:
import pandas as pd
from pathlib import Path
# 1. Read every Excel export in the folder
files = Path("weekly_sales").glob("*.xlsx")
df = pd.concat((pd.read_excel(f) for f in files), ignore_index=True)
# 2. Clean the data
df["Date"] = pd.to_datetime(df["Date"])
df = df.drop_duplicates()
# 3. Summarise sales by branch
summary = (
df.groupby("Branch", as_index=False)["Amount"].sum()
.sort_values("Amount", ascending=False)
)
# 4. Save the report
summary.to_excel("weekly_summary.xlsx", index=False)
print(summary)
About a dozen lines of code, and the whole Monday routine runs in seconds. (You'll need Python installed, plus the pandas and openpyxl packages.)
Taking it further
Once the basics work, Python can do much more:
- Run on a schedule using Windows Task Scheduler or a cron job, so the report is ready before you arrive.
- Pull data directly from databases, APIs, Google Sheets or accounting software, instead of waiting for exports.
- Create charts automatically with libraries like Matplotlib or Plotly.
- Email the report or post it to a team chat when it's ready.
- Flag problems, for example alerting you when a branch's sales drop sharply compared with last week.
Which Should You Choose?
- Choose Power Query if your team lives in Excel, the data isn't huge, and pressing Refresh is acceptable. It's the fastest win with no new tools to install.
- Choose Python if you need full automation, larger datasets, more complex logic, or integration with other systems.
- Use both if it makes sense. Many analysts use Python to prepare data and Excel or Power BI to present it.
AI assistants can help here too. If you get stuck on a Power Query step or a pandas error, describing the problem to an AI tool often gets you unstuck quickly. Just avoid pasting confidential company data into public tools.
Tips for Automation That Lasts
- Standardise your inputs. Automation breaks when column names or file layouts change. Agree on a consistent format with whoever sends the data.
- Start with one report. Automate the most painful one first, then build on what you learn.
- Add simple checks. Compare row counts and totals with the previous week so you notice if something looks wrong.
- Document the process. A short note explaining where files go and how to run the report saves headaches later.
- Keep a human eye on the output. Automation removes the drudgery, not the need for judgement.
Final Thoughts
Every hour spent copying and pasting is an hour not spent understanding what the numbers mean. Whether you start with Power Query this afternoon or write your first Python script this weekend, automating even one weekly report can give you back hours every month, with fewer errors and fresher data.
Need help automating reports, building dashboards or connecting your business data? Talk to the Tecspectra data team. We'd love to help you spend less time on spreadsheets and more time on decisions.


