Advanced Excel for a data analyst is not about memorizing as many functions as possible. It is about mastering a 4-step workflow: merge many files into one table with Power Query, clean the data (dates, numbers stored as text, duplicate rows), add information with XLOOKUP, then summarize and reconcile with SUMIFS or a Pivot Table. A good reporting analyst is the one whose numbers add up and who can explain every dong of difference between raw and cleaned data. This lesson follows that workflow on an example of a 3-store chain sending monthly files, and it works in both Excel and Google Sheets.
By the end of this lesson, you will be able to:
- Arrange raw data into a tidy table using 7 rules (one row per transaction, one column per attribute).
- Detect and fix the 3 most common problems: wrong date formats, numbers stored as text and duplicate rows.
- Use Power Query to merge files with the same structure and save the cleaning steps so next month you only press Refresh.
- Write an XLOOKUP that handles codes it cannot find, and a SUMIFS with several conditions, including a date range.
- Reconcile totals before and after cleaning so you know the report is right before sending it to a manager.
Learning data analysis? Advanced Excel and Google Sheets is step 2 of the roadmap, after analytical thinking and basic statistics, and before SQL. See the 8-step data analyst roadmap to learn in the right order.
How is a data analyst's Excel different from office Excel?
Office staff use Excel to enter data and build a report. A data analyst receives data from many sources (point-of-sale software, e-commerce marketplaces, files typed by each branch), turns it into one clean table, and then answers the business question framed in the lesson what is a data analyst. Most of the time goes into merging and cleaning, not into drawing charts.
The 4-step workflow: merge, clean, look up, summarize
- Merge: bring many files with the same structure into one table.
- Clean: standardize data types, remove extra spaces, drop duplicate rows, fix dates.
- Look up: add product group, region or staff name from a reference table.
- Summarize and reconcile: total by group, compare with the original total, explain any gap.
Skipping step 2 is why numbers often "look reasonable but are wrong".
Excel or Google Sheets: which one?
In Vietnam, banks and large companies usually run Excel on Microsoft 365, while startups and online shops often prefer Google Sheets because it is easy to share. Function names are almost identical, so switching from one to the other is quick. The main differences are below.
| Feature | Excel (Microsoft 365, 2021 and later) | Google Sheets |
|---|---|---|
| XLOOKUP, SUMIFS, UNIQUE, FILTER | Yes | Yes |
| Pivot Table | Yes, with Slicers and Timelines | Yes, simpler |
| Power Query (automated merging and cleaning) | Built in on Windows; fewer features on Mac | No; use IMPORTRANGE, QUERY, Data cleanup |
| Size limit | 1,048,576 rows per sheet | 10 million cells per file |
Excel 2016 and 2019 do not have XLOOKUP; use INDEX/MATCH as explained in the lesson VLOOKUP in Excel from the office IT career.
Tidy data formats: the foundation before any formula
A tidy table is one a machine can read, not one that looks nice when printed. A table with merged cells, subtotal rows in the middle and two-level headers causes trouble for formulas, Pivot Tables and Power Query alike.
The 7 rules of a tidy table
- Each row is one transaction (one order, one delivery).
- Each column is one attribute, with exactly one header row and no blank column names.
- No merged cells, no blank rows, no subtotal rows in the middle.
- One type per column: the date column holds real dates, the money column holds numbers.
- Units go in the column name, for example "Amount (thousand VND)".
- Codes are written consistently: "SP01", never "sp01" one day and "SP 01" the next.
- Next month's data is appended as new rows, not as a new "November" column.
Messy table versus tidy table
| Messy table (common) | Tidy table | Why it matters |
|---|---|---|
| One revenue column per month | One "Date" column, one "Amount" column | Adding a month needs no formula changes |
| Branch name merged across 20 rows | Branch name repeated on every row | Filters and Pivots do not miss rows |
| Values written as "1.5tr" or "150k" | 1500 in a thousand-VND column | Can be added up, no guessing units |
| Cancelled orders colored red | A "Status" column saying "Cancelled" | Formulas cannot read colors |
Turn the range into a Table
Click a cell in the data and press Ctrl + T. A Table grows automatically when you add rows, copies formulas down, and gives Pivot Tables and Power Query the right range. Give it a meaningful name such as Orders or ProductList.
Three common problems: dates, numbers stored as text, duplicate rows
These three problems take up most cleaning time, and Excel usually does not flag them as errors. Each one below follows the same order: symptom, cause, fix.
Wrong date formats
Symptom: some date cells are left-aligned (they are text), filtering by month misses rows, or an October order shows up in July. Cause: Excel stores a date as a number, while the way it reads the string "10/7/2026" depends on the computer's regional settings. A computer set to Vietnamese format reads it as 10 July; software exporting in US format meant 7 October. A string like "25/10/2026" on a US-format computer cannot be read, so it stays as text.
The most dangerous case is a date converted wrongly that is still a valid date: nothing signals an error. Figure 1 shows how the same day can be written under very different conventions.
Photo: Nesnad / Wikimedia Commons, CC BY 4.0
Fix:
- Ask whether the source exports day/month or month/day; ideally ask for year-month-day (2026-10-07).
- For a text column in "dd/mm/yyyy" with 2-digit day and month: Data → Text to Columns, choose Date with DMY in step 3, or use
=DATE(RIGHT(B2,4), MID(B2,4,2), LEFT(B2,2)). - In Power Query: right-click the column → Change Type → Using Locale, and pick the locale that matches the source file.
- Check with a helper column
=MONTH(B2): an October file containing July dates has a problem.
Numbers stored as text
Symptom: numbers are left-aligned with a small green triangle in the corner, and SUM is lower than it should be because it skips text cells. Cause: data copied from the web or from software carries hidden spaces or a leading apostrophe, or the thousands separator does not match the computer (the file says "1.500.000" while the computer expects commas).
Fix: select the column, click the warning icon → Convert to Number. For hidden web spaces (character 160, which TRIM does not remove), use =VALUE(TRIM(SUBSTITUTE(E2, CHAR(160), ""))). The opposite rule applies to product codes, phone numbers and tax codes: keep them as text so leading zeros are not lost.
Duplicate rows
Symptom: total revenue is higher than the accountant's figure, and one order ID appears twice. Cause: pasting twice, exporting overlapping date ranges, merging a weekly file with a monthly file. Fix: first flag duplicates with =COUNTIFS(A:A, A2)>1 to see which rows repeat and why, then use Data → Remove Duplicates (Excel keeps the first occurrence) or Data → Data cleanup in Google Sheets.
Two identical rows are not always duplicates: a customer buying the same item twice is two real transactions. Judge duplicates by an identifying key (order ID), not by the whole row.
Spaces and inconsistent capitals
"SP02 " (with a trailing space) and "SP02" are two different codes to a computer. Use TRIM to remove extra spaces, UPPER for capitals, and CLEAN to strip hidden line breaks; Power Query has the same commands under Transform → Format.
Power Query: merge and clean once, then just press Refresh next month
Power Query is the tool built into Excel (Data → Get Data, also called Get & Transform) that pulls data from files, folders, the web or databases and transforms it through steps that are recorded. You clean once; next month you drop the new files into the folder and press Refresh.
Photo: Tony Webster from Portland, Oregon / Wikimedia Commons, CC BY-SA 2.0
Merge every file in a folder
- Put files with the same column structure (each branch's monthly file, as in Figure 2) in a dedicated folder.
- Data → Get Data → From File → From Folder, and choose the folder.
- Click Combine → Combine & Transform Data and pick the sample sheet.
- Power Query builds a merged table with a source file name column (Source.Name); keep it to know which branch each row came from.
- Clean the data as described below, then Home → Close & Load to send the result to a sheet.
Common cleaning steps
- Remove Rows: drop blank rows, subtotal rows and note rows at the top of a file.
- Change Type / Using Locale: set date and number types according to the source file's locale.
- Trim, Clean, Uppercase: standardize codes and names.
- Remove Duplicates: drop duplicates based on the key column.
- Fill Down: fill values into columns that had merged cells.
- Unpivot Columns: turn a one-column-per-month table into two columns, "Month" and "Value".
Each action appears in the Applied Steps pane; click any step to see the data at that point.
Append versus Merge
Append stacks tables vertically and adds rows, for tables with the same columns (September plus October). Merge joins tables horizontally on a key column, like XLOOKUP or a SQL JOIN. Mixing these two up is a classic beginner mistake.
No Power Query in Google Sheets: what then?
Use IMPORTRANGE to pull data from another file, stack ranges with an array such as ={Sheet1!A2:E; Sheet2!A2:E}, filter and summarize with QUERY or FILTER, then run Data → Data cleanup. That is enough for a few small files; larger data belongs in SQL.
The biggest gain is time (Figure 3): merging 10 files by hand can take a whole morning, while with a saved Power Query you only press Refresh All (Ctrl + Alt + F5) and check the totals.
Photo: Shixart1985 / Wikimedia Commons, CC BY 2.0
XLOOKUP: adding information from a reference table
An orders table usually holds only product codes; to summarize by product group you must bring the "Group" column over from the product list. XLOOKUP is simpler than VLOOKUP: no counting column numbers, it can look to the left, and it has a built-in value for "not found".
Syntax and example
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Example: =XLOOKUP(D2, ProductList!A:A, ProductList!C:C, "Not in list") looks for the code in D2 in column A of the product sheet and returns the group from column C. Computers set to Vietnamese regional format may use semicolons instead of commas between arguments.
Use "if not found" to catch unknown codes
Do not hide errors with an empty string. Write "Not in list" so that, when you summarize, you see at once how much money sits under mistyped codes, new products not yet registered, or codes with trailing spaces. This amount must be reported, never silently dropped.
Common XLOOKUP mistakes
- Duplicate codes in the reference table: XLOOKUP returns the first match. Check with
COUNTIFthat each code appears once. - Ranges of different sizes: a lookup range A2:A100 with a return range C2:C90 returns #VALUE!.
- Numeric versus text codes: code 1001 stored as a number does not match "1001" stored as text. Convert both to the same type.
SUMIFS and Pivot Tables: summarizing and reconciling
SUMIFS gives fixed numbers for a templated report; a Pivot Table is for quickly exploring many angles.
SUMIFS with several conditions and a date range
=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...)
Example, revenue of the Da Nang store in October 2026:
=SUMIFS(E:E, C:C, "Da Nang", B:B, ">="&DATE(2026,10,1), B:B, "<"&DATE(2026,11,1))
Use "less than the 1st of next month" instead of "less than or equal to the 31st" so you do not miss orders with a time of day on the last day of the month. The same logic applies to COUNTIFS for counting and AVERAGEIFS for averages.
Pivot Tables for quick exploration
How to create one, group by month and filter with Slicers is covered in the lesson Excel Pivot Tables from the office IT career. As a data analyst, also remember: always build a Pivot from a Table or a Power Query output, and Refresh it every time the data changes.
Reconcile: totals must match
Every time you clean, record the row count and total amount before, after, and the difference with its reason. The total by branch and the total by product group (including "Not in list") must both equal the overall total. If they do not, do not send the report.
Worked example: merging October reports from a 3-store chain
A grocery chain has 3 stores (Ha Noi, Da Nang, Can Tho), and each sends one order file for October 2026. The manager asks for October revenue by store and by product group. The data is shortened so you can work it out by hand; amounts are in thousand VND.
Data after merging (not yet cleaned)
| Order ID | Date (as in file) | Store | Product code | Amount | Problem |
|---|---|---|---|---|---|
| HN01 | 03/10/2026 | Ha Noi | SP01 | 300 | |
| HN02 | 05/10/2026 | Ha Noi | SP02 | 420 | |
| HN03 | 12/10/2026 | Ha Noi | SP03 | 270 | |
| HN03 | 12/10/2026 | Ha Noi | SP03 | 270 | Pasted twice |
| DN01 | 04/10/2026 | Da Nang | SP01 | 150 | |
| DN02 | 10/7/2026 | Da Nang | SP02 | 840 | Exported month/day, read as 10 July |
| DN03 | 15/10/2026 | Da Nang | SP04 | 240 | |
| DN04 | 20/10/2026 | Da Nang | SP99 | 200 | Code not in product list |
| CT01 | 08/10/2026 | Can Tho | SP01 | 450 | Number stored as text |
| CT02 | 18/10/2026 | Can Tho | SP03 | 180 | |
| CT03 | 25/10/2026 | Can Tho | "SP02 " | 420 | Trailing space in code |
Product list: SP01 is Hair care, SP02 Household, SP03 Food, SP04 Drinks.
Step 1: look at the raw total and notice it is wrong
Adding all 11 rows by hand gives 300 + 420 + 270 + 270 + 150 + 840 + 240 + 200 + 450 + 180 + 420 = 3,740. But SUM on the Amount column shows only 3,290, because the 450 in CT01 is text and gets skipped (3,740 − 450 = 3,290). Two different totals are the signal that the data needs cleaning.
Step 2: clean
- Convert the 450 in CT01 to a number. SUM rises to 3,740.
- Flag duplicates by Order ID: HN03 has 2 rows, and the store confirms it was pasted twice. Delete 1 row: 3,740 − 270 = 3,470.
- Fix the DN02 date to 07/10/2026; otherwise the October SUMIFS for Da Nang misses 840.
- TRIM the product code column so "SP02 " becomes "SP02".
Total after cleaning: 10 rows, 3,470 thousand VND, that is 3,470,000 VND (about USD 130). The gap from the 11 raw rows (3,740) is exactly the 270 of the duplicate row.
Step 3: XLOOKUP the product group and summarize with SUMIFS
Add a Group column with XLOOKUP ("Not in list" when not found), then SUMIFS by store and by product group.
| By store | Rows | Revenue (thousand VND) |
|---|---|---|
| Ha Noi | 300 + 420 + 270 | 990 |
| Da Nang | 150 + 840 + 240 + 200 | 1,430 |
| Can Tho | 450 + 180 + 420 | 1,050 |
| Total | 990 + 1,430 + 1,050 | 3,470 |
| By product group | Rows | Revenue (thousand VND) |
|---|---|---|
| Household (SP02) | 420 + 840 + 420 | 1,680 |
| Hair care (SP01) | 300 + 150 + 450 | 900 |
| Food (SP03) | 270 + 180 | 450 |
| Drinks (SP04) | 240 | 240 |
| Not in list (SP99) | 200 | 200 |
| Total | 1,680 + 900 + 450 + 240 + 200 | 3,470 |
Step 4: reconcile and add notes when sending the report
Both tables add up to 3,470, matching the cleaned total. If you skip TRIM, order CT03 falls into "Not in list" and Household drops to 1,260; if you do not fix the DN02 date, Da Nang drops to 590. Notes with the report: removed 1 duplicate order HN03 (270), fixed the DN02 date, 200 thousand VND remain under code SP99, which is not in the product list; ask the Da Nang store to check.
Mistakes that make an Excel report wrong without anyone noticing
The mistakes below do not show #N/A or #VALUE!, so they slip through easily.
Editing raw data by hand and hard-coding numbers into formulas
If you edit a branch's file directly, nobody will know next month what was changed; keep the original file and clean in Power Query or a separate sheet. A formula like =SUM(E2:E50)+840 to "make up" for a missing order breaks as soon as the data changes: fix the source, not the result.
Sliding ranges and not counting rows
Forgetting the $ makes a lookup range slide as you copy the formula down; a fixed range A2:A100 misses row 101, so use a Table. Merging 3 files with 4, 4 and 3 rows must give 11 rows; count again with COUNTA.
Data privacy note: Sales files often contain customers' names, phone numbers and addresses. Keep only the columns needed for the analysis question, and remove or mask personal information before sharing. Do not send files with customer data over personal chat, and do not set a Google Sheets link to "anyone with the link can view". Follow the personal data protection rules in force in Vietnam and your company's policies; when unsure, ask the legal or IT team.
Frequently asked questions
How long does it take to learn advanced Excel for data analysis?
If you already know basic Excel, it usually takes about 4–6 weeks at 6–8 hours a week to use XLOOKUP, SUMIFS, Pivot Tables and Power Query fluently at a job-ready level. The fastest way is to repeat the 4-step workflow on real data many times.
Does the XLOOKUP function work in Excel 2016?
No. XLOOKUP is available in Microsoft 365, Excel 2021 and later, Excel for the web and Google Sheets. In Excel 2016 and 2019, combine INDEX with MATCH to get the same result.
What is Power Query, and do I need to code?
Power Query is the data import and cleaning tool built into Excel. You work mostly with the mouse, and each step is recorded in the M language. Beginners do not need to write M; they only need to understand each step in Applied Steps.
If I know advanced Excel, do I still need SQL?
Yes. Excel suits small and medium data. Millions of rows in a database must be pulled and aggregated with SQL first. Employers usually test both.
Can Google Sheets clean data as well as Excel?
At a basic level, yes, with Data cleanup and functions such as TRIM, VALUE, SPLIT and QUERY. Without Power Query, a monthly repeat job is harder to automate, unless you add Apps Script.
Practice exercise and self-assessment
Recreate the 11 rows from the example (keep the problems), one file per store, plus a product list file with 4 codes. Then:
- Merge the 3 files with Power Query (From Folder) or with a
={...}array in Google Sheets. - Clean: text numbers, duplicate rows, the DN02 date, spaces in codes.
- Add a Group column with XLOOKUP using "Not in list".
- Build two SUMIFS tables, by store and by product group, then compare them with a Pivot Table.
- Write a 3-line note explaining the gap between raw and clean data.
Self-assessment criteria
| Criterion | Pass | Not yet |
|---|---|---|
| Row count | 11 raw rows, 10 after cleaning | A different count you cannot explain |
| Total amount | 3,470, with both summary tables matching | 3,290, 3,740, or the two tables disagree |
| Dates | Every order falls in October 2026 | An order still in July, or left-aligned date cells |
| Unknown code | The 200 under "Not in list" is mentioned in the note | Ignored or left blank |
| Repeatable | Add a November file, press Refresh, get new numbers | Everything has to be redone by hand |
Once you are confident with this workflow, you will see the limits of spreadsheets: large data slows files down, and merging many tables by hand invites mistakes. The next step on the roadmap is SQL querying & aggregation, where filtering, SUMIFS and XLOOKUP become WHERE, GROUP BY and JOIN. Start with the lesson SQL basics for data analysts, which also uses store chain data, so it will feel familiar (Figure 4).
Photo: Dwalsh3 / Wikimedia Commons, CC BY-SA 4.0
Keep learning data analysis: after advanced Excel come SQL, Python pandas, Power BI or Looker Studio dashboards, data storytelling and a sales analysis project for a retail chain. See the 8-step data analyst roadmap.




