The Complete Excel Course with AI Integration

XLOOKUP and VLOOKUP for payroll administrators

A payroll sheet is only as good as the rates, cost centres and hours it fetches from other files, and a lookup that misses a new starter or reads the wrong column becomes a wrong payment. The Complete Excel Course with AI Integration teaches XLOOKUP, VLOOKUP and INDEX and MATCH on the industry-standard PeopleInsight HR workbook, and this page picks out those lessons with the clean-up that makes IDs match, the keys built from codes and FILTER for every line of one person.

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 each employee's pay rate, department and cost centre onto the payroll sheet by employee ID with XLOOKUP, an exact match by default and the return column chosen directly.
  • Read and repair the VLOOKUP formulas in inherited payroll files: FALSE for an exact match, the table locked with F4, and the column number that breaks when a column is inserted.
  • Give a new starter missing from the master a readable message instead of #N/A, with XLOOKUP's if-not-found answer or IFERROR round VLOOKUP, then count and list everyone it names.
  • Look up a value that sits left of the ID with XLOOKUP or INDEX and MATCH, and read a pay scale grid of grades and steps with a two-way lookup.
  • Make IDs match before a lookup runs: TRIM, Find and Replace and Remove Duplicates on the master, CONCAT to join an ID and a period into one key, LEFT, RIGHT and MID to split a code.
  • List every timesheet line for one person with FILTER, where a lookup stops at the first, and the IDs present on an export with UNIQUE.

Projects

What you will build.

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

  • Project 06

    PeopleInsight HR workbook

    Employee data joined across sheets with one formula.

    Built on HR records, it is the course's nearest thing to a payroll master: staff with department and location codes on one sheet, reference tables on others, and names, partners and regions brought across by ID, with a readable message wherever an ID finds no match.

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

  • Project 02

    Dunder Michael Paper Company employee database

    Built as a company's staff list, it is where a master becomes lookup-ready: stray spaces trimmed, spellings made consistent and repeated Employee IDs found and removed, so each ID belongs to one person before a rate is fetched by it.

Lessons

The lessons that matter, in course order.

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

Where to start

Lesson 67 Lookup functions in Excel

Start at Lesson 67 if you write IF and SUM and keep your lists as tables: the lookups begin there on an HR dataset. If your master file has never been cleaned, take Lesson 22 and Lesson 23 first, because a lookup is only as good as the IDs it matches. Already writing VLOOKUP? Go straight to Lesson 69 for XLOOKUP, its if-not-found answer and the two-way lookup. New to Excel? Begin at Lesson 1.

12 of 186 lessons · 1 h 3 min

03 Managing data in Excel: sort, filter and tables (Dunder Michael Paper employee database) 2 of 9 lessons · 19 min A master a lookup can trust: TRIM and Find and Replace for the stray spaces and second spellings that make two identical-looking IDs differ, Paste Special values to keep the clean text, then the Duplicate Values highlight and Remove Duplicates, so each Employee ID stands for exactly one person. The list is an employee database, close to the one a payroll keys on.
  1. 22 Cleaning data in Excel TRIM, Paste Special values and Find and Replace 13 min
  2. 23 Remove duplicates in Excel Find and delete duplicate rows in an employee list 6 min
08 Advanced Excel functions: lookups, text and arrays 7 of 12 lessons · 31 min Lookups on the PeopleInsight HR dataset: why copying across tabs fails, VLOOKUP with an exact match and a locked table, XLOOKUP with its own if-not-found answer and a two-way lookup, IFERROR for IDs that find nothing, INDEX and MATCH, then CONCAT, TEXTJOIN, LEFT, RIGHT and MID to build or split the codes a lookup matches on.
  1. 67 Start here Lookup functions in Excel The PeopleInsight HR dataset and why lookups matter 2 min
  2. 68 VLOOKUP in Excel Find employee data across sheets with exact match 4 min
  3. 69 XLOOKUP in Excel Exact match, if not found and two-way lookup 6 min
  4. 70 IFERROR in Excel Handle lookup errors in VLOOKUP and XLOOKUP formulas 3 min
  5. 71 INDEX and MATCH in Excel A flexible alternative to VLOOKUP 6 min
  6. 72 CONCAT and TEXTJOIN in Excel Combine employee names and text with a delimiter 3 min
  7. 73 LEFT, RIGHT and MID in Excel Extract parts of a text code like DAL-SAL-0001 7 min
08 Advanced Excel functions: lookups, text and arrays 2 of 12 lessons · 10 min UNIQUE and FILTER, dynamic arrays that need a modern Excel: the distinct IDs or codes in a column, and every row that meets a rule, for the cases where a lookup's single answer is not enough.
  1. 75 UNIQUE function in Excel Extract a distinct list with dynamic arrays 6 min
  2. 76 FILTER function in Excel Dynamic array filtering with AND and OR criteria 5 min
08 Advanced Excel functions: lookups, text and arrays 1 of 12 lessons · 3 min A Ninja Challenge to solve before the answer: XLOOKUP across two sheets for a name and a figure, a total worked out from them and an ID put into one format, which is a pay line in miniature, the rate fetched by ID and multiplied by the hours.
  1. 78 Excel Ninja Challenge XLOOKUP, totals and text concatenation lookup challenge 3 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.

When pay rates are matched to employee IDs, does XLOOKUP make fewer mistakes than VLOOKUP, and where do payroll administrators learn both?

Yes, in most payroll files, and The Complete Excel Course with AI Integration from Coding Liquids teaches both on HR data, so you choose with your eyes open. XLOOKUP looks for an exact match unless told otherwise, points straight at the column to return, so a column inserted into the master cannot shift it, searches to the left as easily as to the right, and carries its own answer for an ID it cannot find (Lesson 69). VLOOKUP needs FALSE for an exact match, counts columns by number and reads only to the right (Lesson 68), yet it fills older files and runs in every version, so it still has to be read and repaired. INDEX and MATCH, the flexible older route, completes the set (Lesson 71). The PeopleInsight project, industry standard and designed after talking with people from many different industries, joins department, HR partner and location details to every employee by ID: the pattern of rates, cost centres and hours joined to a payroll master. The lessons gathered here number 12 lessons and run to 1 hour 3 minutes.

What does a lookup actually do in a pay run?

It fetches each employee's details from the sheet where they are kept, by matching a shared value such as the employee ID, so nothing is copied across by hand. The Complete Excel Course with AI Integration opens its lookup lessons on exactly that problem in Lesson 67: related HR data spread over several sheets, and the warning that copying and pasting between tabs is slow, messy and an invitation to mistakes. In a pay run the same join brings the hourly rate, contracted hours, cost centre and pay group from the master onto every timesheet line, or the approved hours from the timesheet onto the register. One formula, filled down, does it for every row, and when the master changes, the results follow. The lessons join department names, HR partners and locations to an employee list (Lesson 68, Lesson 69); your columns hold pay data, and the formula cannot tell the difference.

A new starter has hours on the timesheet but no row in the master yet: what will my lookup show?

#N/A, unless you give it something better to say, and The Complete Excel Course with AI Integration teaches both ways of turning that into a message someone can act on. XLOOKUP has an if-not-found argument of its own, and Lesson 69 fills it with a short note, so an ID missing from the reference table returns words instead of an error. For VLOOKUP, Lesson 70 changes one department code so it no longer matches, watches the errors appear, then wraps the formula in IFERROR with NOT MATCHED as the answer, and points out that XLOOKUP needs no IFERROR for the same job. Write a note such as Not in master, check starter form, and the gap explains itself to whoever reviews the run. COUNTIF on that note (Lesson 36) gives the number of people still to set up, and a filter on it gives their names. The lesson's warning is one payroll learns the hard way: a single extra letter in a code is enough to break a lookup.

Someone inserted a column in the master and my VLOOKUP now returns the wrong figures: why?

Because VLOOKUP counts columns by number, and The Complete Excel Course with AI Integration lets you watch that fault happen. In Lesson 68 a column is inserted into the lookup table on purpose and the results turn to zeros, since the number in the formula now points at a different column; the lesson undoes it, but on a payroll file nobody may notice until a rate is paid from the wrong column. XLOOKUP avoids the trap by pointing at the return column itself (Lesson 69), so an inserted column moves the reference along with the data, and INDEX with MATCH does the same in any version (Lesson 71). The same lessons show the other classic fault: results that are right at the top and wrong or zero lower down mean the table range was never locked with F4 before the formula was filled down. Both checks take seconds, and both belong in the review of any payroll workbook you inherit.

The employee ID sits to the right of the pay rate in our export: can I still look it up?

Yes, with XLOOKUP or with INDEX and MATCH, and The Complete Excel Course with AI Integration teaches both because VLOOKUP cannot. VLOOKUP searches only the first column of its table and returns values to the right of it, the limit Lesson 71 sets out, so an export with the rate in column B and the ID in column D would need its columns rearranged or a helper column added. XLOOKUP takes a lookup column and a return column separately, wherever each one sits, and searches left as easily as right (Lesson 69). INDEX and MATCH divide the job: MATCH finds the position of the ID in its column, with 0 for an exact match, and INDEX returns the value at that position from any other column (Lesson 71). The lesson builds the pairing on named tables, with the @ sign taking the current row's ID. Exports from payroll and HR systems seldom put the ID first, so this spares you rearranging every file you receive.

Colleagues open our payroll files in an older Excel: should I keep writing VLOOKUP?

Write what every reader of the file can run, and The Complete Excel Course with AI Integration equips you for either case. XLOOKUP needs a modern Excel, as the course points out when it first appears, and an older version cannot calculate it. So a file that travels to those colleagues keeps VLOOKUP, built the safe way Lesson 68 teaches: an exact match with FALSE, the table locked with F4 before filling down, and a check that no column has been inserted into the lookup table since. Better still for shared files is INDEX with MATCH (Lesson 71), which works in every version and lifts VLOOKUP's limits, since it reads left or right and never counts columns. Inside a team where everyone has Microsoft 365, XLOOKUP is the cleaner choice (Lesson 69). That is the real reason so many people still use VLOOKUP: old files and old versions, rather than a better formula.

Can one lookup read a pay scale grid, with grades down the side and steps across the top?

Yes: that is a two-way lookup, and The Complete Excel Course with AI Integration names it in the title of Lesson 69, beside exact match and if-not-found. A two-way lookup finds the row for one value and the column for another and returns the cell where they cross: the grade picks the row, the step picks the column, and the rate comes back without a nested IF in sight. INDEX and MATCH give a second route in Lesson 71: INDEX returns the value at a given row and column of a table, and MATCH supplies each position by finding the grade or the step, with 0 for an exact match. Keep the grid on its own sheet as the single place rates are held, and a pay award means updating that grid once; every employee's rate follows at the next calculation. The lessons read HR department and location tables; a salary scale has the same shape.

Hours come in as several lines per employee: is that a lookup job or a SUMIFS job?

Totals are a SUMIFS job and a single matching row is a lookup job, and The Complete Excel Course with AI Integration teaches the difference. XLOOKUP and VLOOKUP return the first match they find, so on a timesheet with a line per shift they bring back one shift and ignore the rest, with no warning. To add every line for an employee, SUMIFS with the ID as its condition is the tool (Lesson 37, among the formula lessons). To see those lines, FILTER returns every row that meets a rule (Lesson 76): the lesson filters an HR table by location, by job level, by two conditions joined with an asterisk for AND and by alternatives joined with a plus sign for OR. Point it at the timesheet with one employee ID and every shift appears together, ready to check against the total. FILTER needs a modern Excel. The usual pattern is SUMIFS for total hours on the master, XLOOKUP for the rate, then a multiplication for the pay.

IDs look identical on both sheets, yet the lookup still fails: what is wrong?

Usually something you cannot see, and The Complete Excel Course with AI Integration teaches you to find each kind. A stray space at the end of an ID makes it a different value to Excel: Lesson 22 removes such spaces with TRIM in a helper column and pastes the clean values back, and uses Find and Replace for second spellings. A code with one character changed breaks the match, as Lesson 70 shows on purpose. An ID stored as text on one sheet and as a number on the other will not match either, and COUNT against COUNTA down the column reveals which one holds text (Lesson 34, Lesson 35). Codes written in two formats need one format first: LEFT, RIGHT and MID take a code apart (Lesson 73) and CONCAT puts one together (Lesson 72). And if only the lower rows fail, the lookup table was never locked with F4 (Lesson 69). Fix the keys once, and every later run matches.

Two people share an employee ID in the master: which pay rate will the lookup return?

The first one it meets, silently, which is why The Complete Excel Course with AI Integration treats a repeated ID as an error to remove before any lookup runs. Lesson 23 puts it plainly: an ID should work like a passport number, one person and one ID, and a repeated ID usually means a repeated record. The lesson finds them with the Duplicate Values rule in conditional formatting, removes them with Remove Duplicates, and explains the choice that matters on a payroll master: Continue with the current selection clears values from one column only, while Expand the selection removes whole rows. It then shows a gentler method, filtering the table on the repeated IDs and deleting the right row by hand, so you decide which record survives, the old rate or the new one. Run that check on the master before each pay run and the lookups have only one answer to give.

Our timesheet holds a line per person per pay period: how does a lookup match the person and the period together?

Yes, by joining them into one key, and The Complete Excel Course with AI Integration teaches the joining. Lesson 72 combines text with CONCAT, with the ampersand and with TEXTJOIN, whose first argument sets the separator: join the employee ID and the pay period with a separator between them, in a helper column on each sheet, and XLOOKUP matches the pair as a single value. The Ninja Challenge in Lesson 78 uses the same move to put an ID into one format by joining a text prefix to it. The two-way lookup of Lesson 69 answers a different case, where the second condition sits across the top of a grid rather than in a column. And when the second condition is really about adding lines up, a person's hours within one period, SUMIFS with two conditions does the job with no key at all (Lesson 37). Keys built this way also line last period up against this one, row by row.

Can a lookup split a cost centre out of a longer code before matching it?

Yes: LEFT, RIGHT and MID take the code apart first, and The Complete Excel Course with AI Integration teaches them on exactly that kind of code in Lesson 73, a position code that packs a location, a department and a number into one cell. LEFT takes characters from the start, RIGHT from the end and MID from a position you choose, for a length you choose, and the lesson notes that they suit any code holding several facts, employee IDs among them. On a payroll file, a cost centre or pay group buried inside a longer code is lifted into a column of its own, then looked up against the cost centre table with XLOOKUP for its name, budget holder or ledger code. Turn the sheet into a table afterwards, as the lesson does, and the split columns fill down for every new row. One clean key column feeding one lookup is easier to check than a long formula doing both.

Do FILTER, Power Query or AI make XLOOKUP out of date for payroll work?

They work beside it, never in its place, and The Complete Excel Course with AI Integration teaches all of them so each job gets the right tool. XLOOKUP fetches one matching value per row (Lesson 69). FILTER returns every matching row at once (Lesson 76), and UNIQUE returns the distinct values of a column (Lesson 75), for instance the employee IDs that appear on this period's timesheet, to hold against the master; both are dynamic arrays that spill into the cells below, outside a table, and both need a modern Excel. For joining whole tables every period, Power Query merges them with a left join (Lesson 163), further on in the course. AI can draft a formula column for you too (Lesson 95), which helps only if you can read what it wrote. None of these retires XLOOKUP: it remains the everyday join between a payroll sheet and its master.

How long before my lookups are ready for a live pay run?

Sooner than the path's 1 hour 3 minutes suggests, because The Complete Excel Course with AI Integration puts the two core joins first. Lesson 68 and Lesson 69 take only a short stretch between them, and they are enough to rebuild the rate column of a copy of your own register: fetch each rate by employee ID, set it beside the figure already there and let any difference speak for itself. The safeguards follow, IFERROR for IDs that find nothing and INDEX and MATCH for exports with the key on the right, then the text functions that mend keys, then FILTER and UNIQUE. Attempt the Ninja Challenge in Lesson 78 before watching its solution, and you will know the join is yours. A parallel run like that, on a copy beside the live file, is the sensible way to bring any new formula into payroll. It all works in Excel on Windows or Mac, XLOOKUP and the dynamic arrays in a modern version, and lifetime access keeps the lessons to hand whenever a new export lands.

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.