The Complete Excel Course with AI Integration

Power Query for payroll administrators

Each pay period brings the same exports: a timesheet file, an HR update and a register with a column per pay element, each needing repairs before a figure can be trusted. By hand, that costs hours every period. Power Query, taught in The Complete Excel Course with AI Integration on SalesFusion, a project built to industry standard, runs the routine for you, and the lessons gathered here follow a pay period's order: import, repair, label, combine, reshape, load.

Taught by Sagnik Bhattacharya and Virginia Thorn

The Complete Excel Course with AI Integration: Sagnik Bhattacharya and Virginia Thorn

What you will be able to do

At work, you will be able to:

  • Bring the payroll system's CSV export into Power Query through Get Data, so each period's file is repaired by recorded steps instead of by hand.
  • Turn a register that gives every pay element its own column into rows of element and amount with Unpivot Other Columns, and attach each element's ledger account with a merge.
  • Stack every period's export from one folder into a year-to-date table, with each line still naming the file that supplied it.
  • Label correction lines and large payments with custom and conditional columns, so a negative amount is never read as pay.
  • Clear impossible dates and placeholders such as n/a from a timesheet export, and give every pay line its month and its tax year.
  • Reuse one cleaning pipeline for the weekly and the monthly export, then append the two into one table.
  • Put nothing on a sheet but the finished table, keeping every staging query as a connection so the payroll workbook stays light.
  • Profile every column of an export across all its rows before loading, so empty and error values are counted, not guessed.

Projects

What you will build.

The course has 14 industry-standard projects. These two matter most here.

  • Project 12

    SalesFusion

    A sales report that refreshes itself from a folder of files.

    Built as a sales reporting system on faulty CSV exports, lookup files and a folder that gains a file each period, the same raw material a payroll export arrives as: every repair, merge and stack your timesheets and registers need is practised on it before you touch your own files.

  • Project 05

    SalesPlusPerformance

    A sales question answered in seconds, straight from the order data.

    A PivotTable project on order-level sales data that shows where a clean payroll table goes next: department cost broken down by month through date grouping, a slicer per field for narrowing the view, and a refresh that brings each new period in.

Tap or pinch to zoom in, drag to move around. Click or scroll to zoom in, drag to move around.

Lessons

The lessons that matter, in course order.

The Complete Excel Course with AI Integration has 186 lessons. This page picks out 17 of them, 1 h 36 min of video. Each lesson keeps its number in the course.

Where to start

Lesson 153 SalesFusion Power Query project

SalesFusion opens at Lesson 153, the right first lesson once your registers sit in Excel tables and a PivotTable holds no fear: from there the lessons follow a pay period, one export first, then a whole folder. Tables still unfamiliar? Learn them in Lesson 19, and PivotTables from Lesson 57, before the queries; a first-time Excel user starts the course at Lesson 1. Bringing exports in through Get Data already? Lesson 160 is where labels, controls and combining begin. Power Query itself runs without Windows; Windows is needed only for the course's Power Automate section and the Power Pivot lessons.

17 of 186 lessons · 1 h 36 min

15 SalesFusion: advanced data tools and a Power Query modelling system 3 of 21 lessons · 13 min SalesFusion's plan and Power Query's first move: ETL explained as steps recorded once and run every time, the file formats Get Data reads, and a CSV export brought in through Transform Data, which opens it for cleaning before any of it reaches a sheet.
  1. 153 Start here SalesFusion Power Query project Excel ETL pipeline and data model overview 5 min
  2. 154 Introduction to Power Query in Excel The ETL workflow explained 5 min
  3. 155 Import a CSV with Power Query Get data from text and transform data 2 min
15 SalesFusion: advanced data tools and a Power Query modelling system 4 of 21 lessons · 24 min The repairs every export needs: columns removed and renamed with each step logged in Applied Steps, codes trimmed and set in one case, symbols and NA entries replaced, true number and date types set, and period columns added once placeholders and an impossible date are cleared.
  1. 156 Clean columns in Power Query Remove and rename columns for modelling 5 min
  2. 157 Clean text in Power Query Trim, clean, replace values and fix text case 6 min
  3. 158 Data types in Power Query Fix date, whole number, decimal and text types 7 min
  4. 159 Date columns in Power Query Add year, month and year-month fields for reports 7 min
15 SalesFusion: advanced data tools and a Power Query modelling system 3 of 21 lessons · 16 min Logic that lives in the query: a column that subtracts cost from sales, another that divides safely, a band of High or Normal and a label for negative lines, then a Group By of totals and row counts by period and region kept as a check, and Close and Load set to connection only for every working query.
  1. 160 Business logic in Power Query Custom and conditional columns for profitability 6 min
  2. 161 Group By in Power Query Summarise sales by month and region to validate data 5 min
  3. 162 Close and Load in Power Query Connection only, table or Data Model 5 min
15 SalesFusion: advanced data tools and a Power Query modelling system 3 of 21 lessons · 14 min Combining files: a left outer merge that attaches names to codes without losing a row, a finished pipeline duplicated and pointed at the next file, with its merges done again on the new query, and two cleaned tables appended into one.
  1. 163 Merge queries in Power Query Look up product and region names with a left join 5 min
  2. 164 Reuse a Power Query pipeline Duplicate queries for a new year of sales data 5 min
  3. 165 Append queries in Power Query Combine 2024 and 2025 sales tables 3 min
15 SalesFusion: advanced data tools and a Power Query modelling system 3 of 21 lessons · 22 min From Folder: each period's file stacked into a single query and repaired by steps recorded on one sample file, with a column recording the source of every row; profit measures and fiscal years added on top; then the master table, history appended to the folder data with lookups merged in, and nulls hunted after each join.
  1. 166 From Folder in Power Query Combine every sales file in a folder automatically 9 min
  2. 167 From Folder automation in Power Query Profit metrics and fiscal year columns 7 min
  3. 168 Build a sales fact table in Power Query Merge lookups and append history 6 min
15 SalesFusion: advanced data tools and a Power Query modelling system 1 of 21 lessons · 8 min Unpivot for wide files: an export with one column per month reshaped into rows, each holding a period and its amount, by a step that names none of the month columns, so the next one added is simply included.
  1. 173 Unpivot columns in Power Query Turn wide month columns into a long table 8 min

Instructors

Who teaches it.

Virginia Thorn smiling at the camera, dark hair tied back, wearing a navy top.

Instructor, Excel with AI

Virginia Thorn

Emmy Award winner. Teaches Excel with AI at Coding Liquids.

Questions

Asked before starting.

Power Query for payroll administrators: where does it start, with one timesheet export or a year of registers, and which lessons lead from one to the other?

With one export, and it ends with the year: The Complete Excel Course with AI Integration from Coding Liquids builds that whole road with SalesFusion, its industry-standard project designed after talking with people from many different industries, turning each period's repairs into steps that run themselves. A CSV comes in through Get Data; its columns are tidied, its codes trimmed, its amounts and dates given true types and its impossible entries cleared; custom columns label each line; merges attach names and ledger accounts; a folder's worth of period exports becomes one table; and a wide grid becomes rows. Each step is recorded once and replayed on the next export at a refresh. For payroll that covers the timesheet file, the register with a column per pay element and the year-to-date table, all rebuilt in the time it takes to press Refresh. The 17 lessons picked for payroll here run to 1 hour 36 minutes, and the method they teach serves every period after.

Our register has a column for every pay element: can Power Query turn it into rows and attach each element's ledger account?

Yes: Unpivot reshapes it and a merge maps it, two steps The Complete Excel Course with AI Integration teaches on separate files. Lesson 173 takes a budget export laid out month by month across its columns, selects the columns that describe each row and applies Unpivot Other Columns, so every other column becomes rows holding its name and its value; because the step never names the columns it turns, a column added later is taken in at the next refresh. On a register that turns basic pay, overtime, each allowance and each deduction into rows of element and amount. Then Lesson 163 merges a lookup table on a shared code, using Left Outer as the join kind, which keeps every row and fills in the matching details. Merge your mapping of elements to ledger accounts the same way, check for blanks as Lesson 168 does after its merges, and the journal can be totalled by account.

When a year of period files is stacked by Power Query, can I still tell which period each line came from?

Yes: Power Query records each row's source file as it stacks them, and The Complete Excel Course with AI Integration builds that in Lesson 166. Get Data's From Folder, pointed at the folder where the period exports are saved, combines them into one table, and its Source.Name column names the file each row arrived in, so any line of the year-to-date table can be traced back to its own export. The repairs are recorded on one sample file and carried to all the others, and Lesson 167 adds year, month and fiscal year columns, so each line carries its period twice over: by its file and by its date. Lesson 168 then decides what to keep, removing Source.Name from its finished table because extra columns weigh on a growing model; keep it in yours while you reconcile, and drop it once the periods tie.

Corrections reach the export as negative pay lines: can a query label them so they are never read as pay?

Yes: a custom column tests the sign of each amount, the move The Complete Excel Course with AI Integration makes in Lesson 160, where an IsReturn column marks any sale with a negative amount as Return and every other line as Sale. On a pay export the same test sets reversals and corrections apart from ordinary pay, so a PivotTable can show them as their own group instead of quietly netting them into a department's cost. The same lesson adds a conditional column that bands each line as High or Normal against a threshold, the pattern for marking any payment above your review limit, and a Margin column that guards against dividing by zero. Because the logic lives in the query, it runs identically on every refresh, so no two reports built from the export can disagree about which lines are corrections.

Will Power Query catch a timesheet date that cannot exist, or a placeholder such as n/a?

Yes, and The Complete Excel Course with AI Integration teaches the order that makes it work in Lesson 159. The lesson's sales dates hold the same faults a timesheet export does: n/a, the words not a date and a day that never existed. Replace Values clears the placeholders and the impossible date first, because left in place it would break the conversion, and stepping back through Applied Steps confirms each fix. The column then becomes a date, Replace Errors turns anything still unreadable into an empty value you can count, and year, month, month-start and year-month columns are added for reporting. Lesson 161 shows why it matters: the null months in its control query come from dates the raw file held in a form Power Query could not read. For payroll that means every line has a period before a total is struck, and an unreadable date is a line to chase, never a line silently lost.

Our weekly and monthly payrolls export in the same layout: do I build the clean-up twice?

Once is enough: duplicate the finished query and point the copy at the other export, the reuse The Complete Excel Course with AI Integration teaches in Lesson 164. There a whole cleaning pipeline is duplicated, the gear beside its Source step browses to the next file, and every saved step runs on the new data; the lesson then repeats its merges on a new query built from the copy, because duplicating the cleaning query does not carry them over, and it checks the new file's own blanks rather than trusting the old ones. Lesson 165 appends the two cleaned tables into one with Append as New, which leaves both sources untouched and relies on matching column headers. For payroll that gives the weekly and monthly runs one clean-up, one combined table for reporting across both, and a single place to change a step.

Must every cleaning step land on a sheet, or can the payroll workbook hold just the finished table?

Just the finished table, which is the rule The Complete Excel Course with AI Integration calls golden in Lesson 162: load only the final cleaned output into the grid, never every staging step, or the workbook grows slow and bloated. Close and Load To offers three destinations, a table on a sheet, the Data Model or a connection only, and the lesson sets its staging and checking queries to connection only, deletes the sheets they had filled and keeps the queries working in the background, ready for a PivotTable. On payroll that keeps the register file light: the timesheet import, the HR update and the control query stay as connections, the finished table is the one thing on a sheet, and Queries and Connections shows each query's rows and last refresh on a hover. A smaller workbook also opens faster on the day the run is due.

Can Power Query read the CSV our payroll system produces, or the workbook a manager sends?

Yes to both, and The Complete Excel Course with AI Integration starts every query from a file, which is how payroll data usually arrives. Lesson 154 opens Get Data's From File list, which covers CSV and text alongside formats such as JSON, XML and PDF, and Lesson 155 imports a CSV through From Text/CSV, choosing Transform Data so the file opens in the Power Query Editor for cleaning. A manager's workbook comes in through the same menu, and a table already in the open workbook can be read too, which is ordinary Excel rather than a step the lessons show. What matters for payroll is choosing the export your system produces most cleanly, usually the CSV, and importing it the same way every period, so each step downstream meets the same columns and the routine never has to be rebuilt.

Ours is a tax year that starts part-way through the calendar: can Power Query give every pay line its tax year as well as its month?

Yes. In The Complete Excel Course with AI Integration, Lesson 167 gives each row of the folder query fiscal year columns next to its profit figures, and a fiscal year is simply a year counted from whichever month an organisation chooses, which is what a tax year is. Every pay line then shows the tax year its date belongs to, alongside the year, month, month-start and year-month fields from Lesson 159. As the columns are made inside the query, each period file that joins the folder gains them at the next refresh, and a PivotTable totals pay by tax year and month with no helper column on any sheet. Year-end figures, cumulative pay for the year and the same month a year earlier all become a matter of choosing fields. Keep the month number column as well: without it, months sort alphabetically, April ahead of January.

Next period's export gains a column for a new allowance: will the query break?

A query built the way The Complete Excel Course with AI Integration teaches takes most of that in its stride, and the course shows how to mend the rest. Unpivot Other Columns in Lesson 173 names none of the columns it turns into rows, so a new allowance column simply becomes new rows at the next refresh; the lesson's quiz makes exactly that point about a new month. Where a step does trip on a changed export, Applied Steps shows which one, and Lesson 167 clears such an error by deleting the step that caused it, after which, the lesson notes, most Power Query errors vanish. Then rebuild that step on the new layout. For payroll that means a new pay element costs a refresh, or at worst one step redone, instead of a morning spent rebuilding the report around a column nobody warned you about.

Where should each period's exports be saved so the payroll queries keep working, and is the original file ever changed?

In one project folder that stays put, which The Complete Excel Course with AI Integration sets as the rule in Lesson 153: keep every source file in the same folder, or the query connections break. A query reads its file through the path in its Source step, so a renamed folder or a file moved to someone's desktop leaves it looking in the wrong place; Lesson 164 shows the repair, the gear beside the Source step used to browse to the file's new home. For payroll, give each period's exports a fixed folder and a consistent name, and the From Folder query of Lesson 166 picks up each new file there at its next refresh. The originals are never edited: Power Query reads them and builds its own table, so the export stays as the payroll system produced it, the version an auditor will ask to see.

Before loading, can Power Query show how clean each column of the export really is?

Yes: switch on column profiling, as The Complete Excel Course with AI Integration does in Lesson 166, and every column reports on itself before a single row is loaded. The lesson turns on Column quality and Column distribution from the View tab and widens the profile from the opening thousand rows to the whole data set, which on a payroll export matters, since the one bad line is seldom near the top. Then read it the way a pay run needs: the employee ID column should show no empties at all, hours and amounts no errors, and the pay code column only as many distinct entries as your code list holds; a department column with one more distinct entry than you have departments is a spelling to correct. Each finding becomes a repair step in Applied Steps, so next period the same fault is put right before you see it, and the check takes seconds instead of a scroll through thousands of lines.

Excel with AI

See the whole course.

The Complete Excel Course with AI Integration: 16 hours of video in 186 lessons, built around 14 industry-standard projects, with lifetime access, a Certificate of Completion and a 14-day money-back guarantee.