Skip to content
PracticeGuru LearningsBlog for tax and accounts offices

Office skills

Power Query and Macros for Accountants: Automate Excel

By PracticeGuru Learnings team · Published 20 Oct 2026 · 10 min read

For CAs, CSs, CMAs, tax consultants, advocates' offices and their office staff.

Banner: Power Query and macros for accountants, automate monthly Excel jobs
In this article
  1. Which jobs to automate: the monthly-repeat test
  2. Which Excel you need
  3. Power Query for accountants: before and after
  4. Where macros fit, and what can go wrong
  5. Macro safety rules for the office
  6. Make it last: queries that survive next month
  7. Questions people ask
  8. Sources
Key points
  • Power Query cleans, combines and reshapes data, then repeats every step with one Refresh. It never changes the original file.
  • Macros repeat actions on a workbook, such as formatting, splitting and saving as PDF, with one button.
  • Use the monthly-repeat test: comes back every month, same layout, over 15 minutes, fixed rules. Four yeses, automate it.
  • Microsoft Office on Windows blocks macros in files from the internet by default. Keep one trusted folder and review any code before use.
  • Build on Windows desktop Excel; Excel for the web and phones cannot do all of this.

Power Query for accountants solves one specific problem: the Excel job you did last month, and will do again next month, step for step. Cleaning the same bank statement download, copying eight staff timesheets into one sheet, stacking four branch fee registers. This guide shows which jobs suit Power Query, which suit macros, what a monthly job looks like before and after, and the safety rules that keep macros from becoming a risk in your office.

Both tools are already inside your Excel. Power Query cleans and joins data, then repeats the cleaning with one Refresh. Macros repeat actions on a workbook, such as formatting, splitting and saving, with one button.

Which jobs to automate: the monthly-repeat test

Before you automate anything, ask four questions about the job:

  1. Does it come back every month or every week?
  2. Does the data arrive in the same layout each time?
  3. Does it take more than 15 minutes by hand?
  4. Are the steps fixed rules, with no judgement?

Four yeses: automate it. A "no" to question 4 means a person must still decide, so automate only the boring part around the decision. A "no" to question 2 means fix the source first, for example by asking for the same export format every time.

Formula, Power Query or macro?

Think of the three tools as three different staff members.

  • A formula does one calculation next to the data, such as days since an invoice or a client name looked up from a code. It recalculates by itself, but it cannot clean or reshape a messy file.
  • Power Query is the person who tidies the data before anyone uses it: removes junk rows, fixes dates, joins two lists, stacks twelve files. It writes down every step and repeats them on demand. It never touches the original file, so a mistake costs you nothing.
  • A macro is the person who does things to the workbook itself: formats, splits, saves, protects. It is powerful, which is also why it needs rules. A macro can delete or overwrite data, and there is no undo.

A good rule of thumb: if the job is about getting clean data, use Power Query. If it is about doing something with the finished workbook, use a macro.

Monthly job by handBest tool
Clean the office bank statement downloadPower Query
Copy eight staff timesheet files into one sheetPower Query (From Folder)
Stack the fee register sheets of four branchesPower Query
Add client name and partner to each invoicePower Query (Merge)
Find clients with no invoice this yearPower Query (Merge, Left Anti)
Fix a fee report with months across the topPower Query (Unpivot)
Partner-wise billed, collected and outstanding by agePower Query (Group By)
Mark invoices older than 60 daysA formula
Format the monthly billing reportMacro
One file per client from the work listMacro

Seven of these ten are Power Query jobs. That is typical, which is why most offices should learn Power Query before macros. For the formula side, see Excel for Chartered Accountants: The Formulas You Need.

One warning before you start. Power Query does not fix weak Excel basics. If staff still struggle with lookups, SUMIFS or a pivot table, an automated query only produces wrong answers faster.

Which Excel you need

  • Windows desktop Excel, Microsoft 365: the full feature set. Build here.
  • Excel 2016, 2019 and 2021 for Windows: Power Query is on the Data tab, in the Get & Transform group. Most features are there; some screens may differ.
  • Mac: only Excel for Microsoft 365 has Power Query, with fewer data sources. The macros most offices use are written for Windows.
  • Excel for the web: can import, edit and refresh Power Query queries, but cannot create, run or edit VBA macros. Phones: fine for viewing. For the full workflow in this guide, including macros, use Windows desktop Excel.
Tip Quick check: open the Data tab and look for Get Data in the Get & Transform group. If it is there, you can start today.
Course: Excel Automation for Tax & Accounts Offices: Power Query & MacrosBuild these step by step with practice files

Excel Automation for Tax & Accounts Offices is 13 short lessons with practice files: clean, combine, merge, unpivot and summarise with Power Query, then record, edit and safely use macros for everyday office jobs.

Power Query for accountants: before and after

The easiest way to see what Power Query does is to look at one monthly job, before and after. Take the office bank statement download: the file that arrives each month with bank logos in the first rows, dates stored as text and blank lines in between.

Before: by hand, every monthAfter: built once
Junk rowsDelete the logo lines and the footer by handRemoved automatically, by a step saved in the query
DatesRetype or fix text dates, and hope nothing was misreadRead in the Indian day-month order, the same way every time
AmountsConvert numbers stored as text, column by columnSet once as numbers
Time taken40 to 60 minutes, and a different result each personOne Refresh, then two minutes to check the totals
The original fileOften edited and saved over by mistakeNever changed. The query only reads it.

The same story repeats across the office. Eight staff timesheet files become one table with a single Refresh. Four branch fee registers stack into one list. A fee report with April to March across the top turns into a proper list that a pivot table can use. A partner-wise summary of billed, collected and outstanding amounts refreshes with the data. The same approach feeds a client MIS, described in MIS Report Format in Excel for Clients (Free Template).

How does it work? Power Query writes down every step you take on the data, in order, and repeats them on demand. You can look at any step to see the data at that point, and remove a step you got wrong. That written record is also what makes the work checkable by someone else.

Illustrative example On the 3rd of every month, Swati spent her whole afternoon on the same bank statement, the same timesheets and the same billing report. After two weeks of practice, the three jobs became three Refresh clicks. She now spends that afternoon checking the results instead of building them.

The catch is the first build. Power Query has its own editor and its own words: applied steps, merge, join kind, unpivot, group by. Most people give up when they try it on a live office file with no guide, a date reads wrong, and nobody knows which step caused it. Two weeks of practice on safe data is what made the difference for Swati.

One export many offices repeat every year is the client trial balance for finalisation. If that is your biggest repeat job, our own SignReady imports the trial balance from Tally or Excel and runs the standard checks, so you may not need to build that query yourself.

Where macros fit, and what can go wrong

A macro is a recorded set of actions. Use one when Excel has to do something to a workbook: format the monthly billing report, split a work list into one file per client code, save chosen sheets as PDF, protect all sheets against accidental changes. You do the steps once while Excel watches, and the macro repeats them with one button.

That sounds simple, and recording is simple. The problems come later:

  • Hard-coded rows. A recorded macro often remembers the exact rows you used. Next month the report has more rows, and the totals land in the wrong place.
  • No undo. A macro can delete or overwrite data, and Ctrl+Z will not bring it back.
  • One person knows it. The macro works while its author is in the office. When that person leaves, nobody knows what it does or how to fix it.
  • Code from outside. Code copied from the internet or written by AI can do more than you think, on real client files.

Every one of these can be managed. A macro that is tested on a copy, edited so it finds the last row by itself, and written down with an owner and a rollback note is a safe office tool. A macro without those is a risk sitting in a shared folder.

Macro safety rules for the office

Macros can run code within the permissions of the user who runs them. That is why Microsoft Office on Windows blocks macros in files from the internet, such as email attachments, by default, and shows a security risk banner instead. Treat that banner as a feature, not a nuisance.

Checklist
  • Emailed .xlsm files from outside the office are not opened with macros enabled. If a file is verified, unblock that one file only (right-click, Properties, Unblock).
  • One trusted folder, and only one, for the office macro workbook. Control who can save files there.
  • Macros cannot be undone with Ctrl+Z. Always run on a copy, or save first.
  • Only named people may write or change office macros.
  • Code from AI or the internet is read and tested on practice data before anyone uses it on real files.

An AI tool can write or explain macro code well if you describe the workbook layout. Never paste real client data into the chat. Our AI Automation for CA Firms: Office Jobs to Automate First guide covers the wider office automation picture, beyond Excel.

Make it last: queries that survive next month

A query built in one afternoon can break in month three. The usual causes are simple: a column header changed in the source file, text appeared in a number column, or someone moved the folder. Three habits prevent most breaks.

  • Write down a check number when you build the query: the row count and the total of the amount column. After every Refresh, compare.
  • Do not hide errors with Remove Errors. Find out which rows failed and why.
  • Keep a handover sheet in each workbook: what each query or macro does, the source folder, the owner, and the monthly check.

The handover sheet matters most in a team. In many offices one keen person builds the queries, then moves on, and the rest of the office goes back to doing the job by hand because nobody else understands it.

If a job is a one-off or changes every time, it is not worth automating. Keep using formulas, taught in the Excel for Tax Practice course. If it comes back every month in the same shape, build it once.

What the course gives you

This article stops at the "what" and the "why". The Excel Automation for Tax & Accounts Offices course covers the "how": practice files for every lesson in start and finished versions, numbered clicks with "what you should see", the Indian date and number fixes for software exports, folder paths that survive a move, and a handover sheet for every query and macro. Start with the free first lesson on what Power Query and macros do, and list your own monthly jobs as you read.

Questions people ask

What is Power Query used for in accounting?

Cleaning and combining data that arrives in the same layout every month: bank statement downloads, staff timesheets, branch registers and software exports. You build the steps once, and next month you click Refresh.

Is Power Query better than macros?

They do different jobs. Power Query is best for cleaning, combining and reshaping data, and it never changes the source file. Macros are best for actions on a workbook, such as formatting, splitting into files or saving as PDF. Most offices need Power Query first.

Which Excel version has Power Query?

Excel for Windows from Excel 2016 onwards, including Microsoft 365, has it on the Data tab under Get & Transform. On a Mac, only Excel for Microsoft 365 has it. Build on Windows desktop Excel for the full feature set.

Are Excel macros safe?

Macros can run code, which is why Office on Windows blocks macros in files from the internet by default. They are safe when they come from your own office, live in one trusted folder, are reviewed before use and are run on a copy first.

Do I need to know coding to use macros?

No. You can record a macro by doing the steps once while Excel watches. Small edits to the recorded code, such as fixing a hard-coded range, are easy to learn and make the macro reliable.

Sources

Course: Excel Automation for Tax & Accounts Offices: Power Query & MacrosTurn your monthly Excel jobs into one click

Try the free first lesson of Excel Automation for Tax & Accounts Offices and list your own monthly jobs. The Office plan includes every course for the whole office, including Excel for Tax Practice.

Share with your team: WhatsApp LinkedIn X
About this article. Written by the PracticeGuru Learnings team at PracticeGuru (Brainy Accountant Solutions Pvt Ltd). Learnings courses are our product and are mentioned where they fit. This is general information, not professional or legal advice.