Excel Mastery A Complete Step-by-Step Guide Using the PaySim Financial Fraud Dataset From Opening a File to Advanced Analysis — Everything Explained Optimised for Microsoft Excel on macOS Dataset: PaySim Synthetic Financial Transactions | Rows: ~6.3 million | Columns: 11 Table of Contents Chapter 1 — Understanding the Dataset • What is PaySim? • Column-by-column breakdown • How to read the data Chapter 2 — Opening & Setting Up in Excel (Mac) • Opening the CSV • Freezing panes • Adjusting columns • Saving as .xlsx Chapter 3 — Sorting & Filtering • AutoFilter • Sort by amount • Multi-level sort • Filter by transaction type Chapter 4 — Essential Formulas • SUM, AVERAGE, MIN, MAX, COUNT • IF statements • COUNTIF and SUMIF • IFERROR • TEXT and DATE functions Chapter 5 — Conditional Formatting • Highlight fraud rows • Colour scales on amounts • Data bars Chapter 6 — Pivot Tables • Creating your first pivot • Rows, Columns, Values • Slicers • Summarising fraud by type Chapter 7 — Charts & Visualisation • Bar chart of transaction types • Pie chart of fraud share • Line chart of volume over time • Chart formatting Chapter 8 — VLOOKUP & XLOOKUP • What lookup functions do • VLOOKUP syntax • XLOOKUP (modern approach) Chapter 9 — Data Cleaning Techniques • Finding blanks • Removing duplicates • Text-to-Columns • Trim and Clean functions Chapter 10 — Real-World Mini Projects • Fraud summary dashboard • Top 10 largest transactions • Customer transaction history lookup • Fraud rate by type Chapter 11 — Keyboard Shortcuts (Mac) • Navigation • Formatting • Formulas and selection Chapter 1 Understanding the Dataset 1.1 What is PaySim? PaySim is a synthetic (fake but realistic) dataset of mobile money transactions. It was created by researchers to simulate financial fraud, making it perfect for learning data analysis because it contains both normal and fraudulent transactions. The full dataset has over 6.3 million rows — each row is one transaction. For learning purposes, you can work with a smaller sample (e.g. the first 50,000 rows) so Excel stays responsive on your Mac. ■ WHY ARE WE DOING THIS? Understanding what the data represents before you touch it is the most important step in any analysis. If you don't know what a column means, any formula or chart you build around it is meaningless. Always read the data dictionary first. 1.2 Column-by-Column Breakdown The dataset has 11 columns. Here is exactly what each one means: Column Data Type What It Means Example Value step Number Hour of the simulation (1 = hour 1, up to 744 = 31 days) 1 type Text Type of transaction: CASH-IN, CASH-OUT, DEBIT, PAYMENT, TRANSFER TRANSFER amount Number Value of the transaction in local currency 9839.64 nameOrig Text ID of the customer who initiated the transaction C1231006815 oldbalanceOrg Number Sender's account balance BEFORE the transaction 170136.0 newbalanceOri g Number Sender's account balance AFTER the transaction 160296.36 nameDest Text ID of the recipient (customer or merchant) M1979787155 oldbalanceDest Number Recipient's balance BEFORE the transaction 0.0 newbalanceDe st Number Recipient's balance AFTER the transaction 0.0 isFraud 0 or 1 1 = this transaction was fraudulent. 0 = legitimate 0 isFlaggedFraud 0 or 1 1 = the system flagged it as suspicious. 0 = not flagged 0 1.3 How to Read the Data Think of each row as a bank statement line. Here is how to read a single row: Field Value What It Tells You step 1 This happened in hour 1 of the simulation type TRANSFER Money was transferred from one account to another amount 9,839.64 The amount transferred was $9,839.64 nameOrig C1231006815 Customer C1231006815 sent the money oldbalanceOrg 170,136.00 Their balance was $170,136 before sending newbalanceOrig 160,296.36 After sending, their balance dropped to $160,296.36 nameDest C1666544295 It was received by account C1666544295 isFraud 1 ■■ This was a fraudulent transaction isFlaggedFraud 0 The automated system did NOT catch it — it slipped through! ■■ WATCH OUT Notice isFraud = 1 but isFlaggedFraud = 0. This is the core challenge — fraud happened but the system missed it. Your analysis will explore patterns like this. Chapter 2 Opening & Setting Up in Excel on Mac 2.1 Opening the CSV File The file you downloaded is a .csv (Comma-Separated Values) file. This is a plain text file where each column is separated by a comma. Excel can open it directly. 1 Open Excel Launch Microsoft Excel from your Applications folder or Dock. 2 File → Open Press Cmd+O or click File in the menu bar, then Open. 3 Find the file Navigate to your Downloads folder and select PS_20174392719_1491204439457_log.csv (or whatever the file is named). 4 Click Open Excel will automatically detect it is a CSV and open it. You should see 11 columns and data starting from row 2. 5 Check row 1 Row 1 should contain the headers: step, type, amount, nameOrig, oldbalanceOrg, newbalanceOrig, nameDest, oldbalanceDest, newbalanceDest, isFraud, isFlaggedFraud. ■ MAC TIP If numbers look like text (left-aligned instead of right-aligned), the import may have defaulted them to text format. Select the column, go to Format → Cells → Number and change the category to Number. 2.2 Saving as an Excel Workbook CSV files cannot store formulas, formatting, or multiple sheets. Save a proper Excel copy immediately so your work is never lost. 1 File → Save As Press Cmd+Shift+S to open the Save As dialog. 2 Change file format Click the dropdown next to 'File Format' and choose Excel Workbook (.xlsx). 3 Rename it Give it a meaningful name, e.g. PaySim_Analysis.xlsx. 4 Save Click Save. From now on, always work with this .xlsx file. 2.3 Freezing the Header Row When you scroll down through thousands of rows, the header row disappears and you lose track of what each column is. Freezing pins the header so it stays visible at all times. 1 Click on cell A2 Click the cell in row 2, column A — this is the first data row, just below the header. 2 Go to View menu Click View in the top menu bar. 3 Click Freeze Rows & Columns This freezes everything above and to the left of your selected cell — so row 1 (the header) stays frozen. 4 Test it Scroll down. Row 1 (step, type, amount...) should stay visible at the top no matter how far you scroll. ■ WHY ARE WE DOING THIS? With 6 million rows, you will constantly be scrolling. Freezing the header is a professional habit — you should always do this as your very first step with any large dataset. 2.4 Adjusting Column Widths Some columns will be too narrow to read the full values. You can auto-fit all columns at once. 1 Select all cells Press Cmd+A to select the entire sheet. 2 Format → Column → AutoFit In the Home tab or Format menu, click AutoFit Column Width. Every column will resize to fit its content. 3 Manually adjust You can also double-click the border between two column letters (e.g. between A and B in the header row) to auto-fit just that column. ■ MAC TIP Hold Option while clicking and dragging a column border to resize multiple selected columns to exactly the same width. Chapter 3 Sorting & Filtering 3.1 Turning on AutoFilter AutoFilter adds dropdown arrows to every column header so you can instantly filter the data to show only what you want. It is one of Excel's most powerful basic tools. 1 Click any cell in row 1 Click on the header row — for example, cell A1 (where it says 'step'). 2 Go to Data tab Click the Data tab in the ribbon at the top. 3 Click Filter Click the Filter button. Small dropdown arrows will appear in each header cell. 4 Try it Click the dropdown arrow on the 'type' column. You will see: CASH-IN, CASH-OUT, DEBIT, PAYMENT, TRANSFER. Tick only 'TRANSFER' and click OK — the sheet now shows only TRANSFER transactions. 5 Clear the filter Click the dropdown again and choose 'Clear Filter from type' to see all rows again. ■ WHY ARE WE DOING THIS? Filtering lets you answer questions like 'Show me only fraud transactions' or 'Show me only TRANSFER type transactions over $100,000' without touching a single formula. This is how analysts quickly investigate a dataset. 3.2 Sorting the Data Sorting reorganises your rows based on the values in a column — either smallest to largest (ascending) or largest to smallest (descending). 1 Click on the 'amount' column header Click on cell C1 where it says 'amount'. 2 Data → Sort Descending In the Data tab, click the Z→A button (Sort Descending). The largest transactions will appear at the top. 3 Read the result The top rows will show the biggest transactions in the dataset — useful for spotting unusual activity. Multi-Level Sort Sometimes you want to sort by more than one column. For example: first sort by type (alphabetically), then within each type, sort by amount (largest first). 1 Data → Sort Click the Data tab then click the Sort button (not just the Z→A button). 2 Set first sort level Under 'Sort by', choose 'type' and set Order to A to Z. 3 Add a second level Click 'Add Level'. Under 'Then by', choose 'amount' and set Order to Largest to Smallest. 4 Click OK The data is now sorted: first alphabetically by type, then within each type by amount descending. ■■ WATCH OUT Never sort a dataset without selecting the entire table first (Cmd+A). If you only select one column and sort, that column's values shift but all the other columns stay in place — your data becomes completely scrambled and unrecoverable. 3.3 Using Number Filters You can filter by number ranges — for example, showing only transactions above $1,000,000. 1 Click the dropdown on 'amount' Click the filter arrow on the amount column. 2 Number Filters → Greater Than Hover over 'Number Filters' then click 'Greater Than'. 3 Enter 1000000 Type 1000000 in the box and click OK. 4 Read the results You will see only transactions where the amount exceeded $1 million. Chapter 4 Essential Formulas Formulas are the engine of Excel. Every formula starts with an = sign. Excel then calculates the result. Below we cover every core formula you need, applied directly to the PaySim data. 4.1 Understanding Cell References Before formulas make sense, you need to understand how Excel refers to cells. A cell reference is just its column letter + row number. Reference What It Means Example C2 Column C, Row 2 — a single cell The 'amount' value for the first data row C2:C1000 A range from C2 to C1000 — all amount values in rows 2–1000 Used in SUM(C2:C1000) $C$2 Absolute reference — the $ signs lock it. When you copy a formula, this cell stays fixed. Used in formulas that always refer back to one specific cell C:C Entire column C — all rows Useful but slower on large data 4.2 Basic Statistical Formulas Create a new sheet (click the + button at the bottom) called 'Summary' and follow along. These formulas will analyse the amount column (column C in the main data sheet, which we will call Sheet1). =SUM(Sheet1!C2:C50000) Adds up all values in the range. Here it totals all transaction amounts. Example: If 50,000 transactions average $50,000 each, this returns ~$2.5 billion =AVERAGE(Sheet1!C2:C50000) Calculates the mean (add all values, divide by count). Gives you the typical transaction size. Example: Might return something like 179,861.90 =MIN(Sheet1!C2:C50000) Returns the smallest value in the range — the lowest transaction amount. Example: Could return 0.01 (very small transaction) =MAX(Sheet1!C2:C50000) Returns the largest value — the highest transaction ever recorded in the dataset. Example: Could return 92,445,516.64 =COUNT(Sheet1!C2:C50000) Counts how many cells contain numbers. Useful for knowing how many transactions you have. Example: Returns 50000 if all 50,000 rows have an amount =COUNTA(Sheet1!B2:B50000) Counts cells that are not empty — works on text too. Use on the 'type' column. Example: Returns 50000 confirming no missing values =MEDIAN(Sheet1!C2:C50000) The middle value when all amounts are sorted. Less affected by extreme values than AVERAGE. Example: Often lower than AVERAGE because a few huge transactions pull the average up =STDEV(Sheet1!C2:C50000) Standard deviation — measures how spread out the values are. A high STDEV means amounts vary a lot. Example: High STDEV expected here — transactions range from cents to millions ■ WHY ARE WE DOING THIS? These six formulas — SUM, AVERAGE, MIN, MAX, COUNT, MEDIAN — are the 'vital signs' of any numeric column. Any time you encounter a new dataset, run these on every number column first. They immediately tell you the scale, typical value, and range of your data. 4.3 The IF Formula IF is the most important logical formula in Excel. It checks a condition and returns one value if true, another if false. The structure is: =IF(condition, value_if_true, value_if_false) If the condition is met, return the first value. Otherwise return the second. Applied to PaySim — let's label each transaction: 1 Go to Sheet1 Click on your main data sheet. 2 Click on cell L2 Column L is empty — to the right of isFlaggedFraud. Click L1 and type the header: FraudLabel 3 Click on cell L2 Click on the first data row in column L. 4 Enter the formula Type: =IF(J2=1,"FRAUD","LEGITIMATE") and press Enter. 5 Read it aloud It says: IF the value in J2 (isFraud) equals 1, show FRAUD, otherwise show LEGITIMATE. 6 Copy down Click L2, then press Cmd+C to copy. Select L3:L50001 and press Cmd+V to paste. The formula fills down automatically, adjusting the row number each time. Nested IF — More than Two Outcomes You can put an IF inside another IF to handle multiple conditions: =IF(J2=1,"FRAUD",IF(K2=1,"FLAGGED","OK")) If isFraud=1 → FRAUD. If isFlaggedFraud=1 → FLAGGED. Otherwise → OK. Example: This creates three categories instead of two. 4.4 COUNTIF and SUMIF These are conditional counting and summing formulas — among the most used in business analysis. =COUNTIF(range, criteria) Counts cells that match a condition. Examples on the PaySim data: =COUNTIF(Sheet1!B:B,"TRANSFER") Counts all rows where the type column says TRANSFER. Example: How many TRANSFER transactions are there? =COUNTIF(Sheet1!J:J,1) Counts all rows where isFraud = 1. Example: How many fraudulent transactions are there? =COUNTIF(Sheet1!C:C,">1000000") Counts transactions with amount greater than 1 million. Example: How many large transactions exist? =SUMIF(range, criteria, sum_range) Adds values in sum_range only for rows where range matches the criteria. =SUMIF(Sheet1!J:J,1,Sheet1!C:C) Adds up the 'amount' column only for rows where isFraud=1. This gives you the total money lost to fraud. Example: Total $ value of all fraudulent transactions =SUMIF(Sheet1!B:B,"CASH-OUT",Sheet1!C:C) Total value of all CASH-OUT transactions. ■ WHY ARE WE DOING THIS? COUNTIF and SUMIF are your go-to formulas for segmented analysis. Instead of filtering and manually counting, they calculate in the background so you can compare multiple segments side by side. In the MPA programme, you will use these constantly for policy analysis, financial summaries, and budget breakdowns. 4.5 IFERROR — Handling Errors Gracefully Sometimes a formula produces an error — for example, dividing by zero (#DIV/0!) or looking up a value that doesn't exist (#N/A). IFERROR wraps around your formula and shows something cleaner instead of the error. =IFERROR(your_formula, "what to show instead") If the formula errors, show the fallback value. Otherwise, show the formula result. Example: =IFERROR(C2/D2, "N/A") PaySim application — fraud rate calculation: =IFERROR(COUNTIF(J:J,1)/COUNT(J:J),0) Calculates fraud rate as a percentage. If COUNT returns 0 (empty data), IFERROR returns 0 instead of crashing. Example: Returns something like 0.0013 = 0.13% fraud rate 4.6 TEXT and Percentage Formatting Numbers need context. A value of 0.0013 is hard to read — displaying it as 0.13% is much clearer. You can either format the cell or use the TEXT formula. 1 Select the cell with 0.0013 Click on the cell containing your fraud rate decimal. 2 Press Cmd+1 This opens the Format Cells dialog — the master formatting window. 3 Choose Percentage Click 'Percentage' in the Category list. Set decimal places to 2. 4 Click OK The cell now shows 0.13% instead of 0.0013. =TEXT(value, format_code) Converts a number to text with specific formatting. Useful when you want the formatted number inside a sentence. Example: =TEXT(0.0013,"0.00%") returns the text string '0.13%' Chapter 5 Conditional Formatting Conditional formatting automatically changes how a cell looks — its colour, font, or borders — based on its value. It lets you visually identify patterns instantly without reading every number. 5.1 Highlight All Fraud Rows Let's make every fraudulent transaction row turn red — so you can spot fraud at a glance. 1 Select the data range Press Cmd+A to select all data, or manually select A2:K50001. 2 Home → Conditional Formatting In the Home tab, click Conditional Formatting then 'New Rule'. 3 Choose 'Use a formula' Select the option that says 'Use a formula to determine which cells to format'. 4 Enter the formula Type: =$J2=1 (The $ before J locks the column — it always checks column J — but the row number changes for each row.) 5 Set the format Click the Format button. Go to Fill tab and choose a red colour. Click OK. 6 Click OK again Apply the rule. Every row where isFraud=1 should now be highlighted red. ■ WHY ARE WE DOING THIS? The $ in =$J2=1 is critical. It tells Excel: always look in column J, but move down the rows as you apply the rule to each row. Without the $, the formula would shift and check the wrong column on some rows. 5.2 Colour Scale on Transaction Amounts A colour scale automatically applies a gradient of colours across a range — green for low values, red for high. This instantly shows you the distribution of transaction sizes. 1 Select the amount column Click the C column header to select the entire amount column. 2 Conditional Formatting → Color Scales In Home tab, click Conditional Formatting → Color Scales and choose the Green-Yellow-Red scale. 3 Read the result Small amounts appear green, medium amounts yellow, and the largest amounts red. You can instantly see where large transactions cluster. 5.3 Data Bars Data bars draw a mini horizontal bar inside each cell, proportional to its value. It turns your column into a built-in bar chart. 1 Select amount column (C) Click on column C. 2 Conditional Formatting → Data Bars Click Conditional Formatting → Data Bars → choose any colour style. 3 See the result Each amount cell now has a bar that shows its relative size visually. ■ MAC TIP To manage or delete conditional formatting rules, go to Conditional Formatting → Manage Rules. You can see all rules applied to the current sheet and delete or edit them. Chapter 6 Pivot Tables Pivot tables are Excel's most powerful analysis tool. They let you summarise, group, and count millions of rows in seconds — without writing a single formula. A pivot table takes your raw data and organises it into a summary table based on categories you choose. 6.1 Creating Your First Pivot Table Goal: Count how many transactions of each type exist (CASH-IN, CASH-OUT, etc.) and see the total amount for each type. 1 Click anywhere in your data Click any cell in Sheet1 — anywhere inside the data. 2 Insert → PivotTable Click the Insert tab, then click PivotTable. 3 Choose New Worksheet In the dialog, select 'New Worksheet' and click OK. A new sheet opens with the pivot table builder on the right. 4 Find the field list On the right side, you will see a panel with all 11 column names listed. These are your 'fields'. 5 Add 'type' to Rows Drag 'type' from the field list down to the 'Rows' box at the bottom. The five transaction types appear on the left of your pivot table. 6 Add 'amount' to Values Drag 'amount' to the 'Values' box. Excel automatically sums the amount for each transaction type. 7 Read the results You now have a table showing Total Amount per transaction type — in seconds, across potentially millions of rows. ■ WHY ARE WE DOING THIS? A pivot table that took you 30 seconds just replaced what could be hours of manual sorting and SUMIF formulas. This is the single skill that most impresses colleagues and managers — knowing pivot tables makes you look like an advanced Excel user immediately. 6.2 Understanding Rows, Columns, and Values The pivot table builder has four areas. Understanding them is everything: Area What Goes Here Effect Rows A category field (e.g. type, isFraud) Each unique value in this field becomes a row in the summary Columns Another category (optional) Creates sub-columns — e.g. break down type by isFraud status Values A numeric field (e.g. amount) Excel calculates SUM, COUNT, AVERAGE etc. for each group Filters Any field you want to filter by Adds a dropdown at the top so you can show one slice at a time 6.3 Fraud Analysis with Pivot Tables Now let's answer: for each transaction type, how many were fraudulent vs legitimate? 1 Clear existing fields Remove current fields by dragging them out of the boxes (or unticking them in the field list). 2 type → Rows Drag 'type' to Rows. 3 isFraud → Columns Drag 'isFraud' to Columns. Now you will see columns for 0 (not fraud) and 1 (fraud). 4 amount → Values Drag 'amount' to Values. It defaults to SUM. 5 Change to COUNT Click the dropdown on 'Sum of amount' in the Values box → Value Field Settings → choose Count. 6 Read the table You can now see exactly how many TRANSFER transactions were fraudulent (isFraud=1) versus legitimate (isFraud=0). You might discover fraud ONLY appears in TRANSFER and CASH-OUT types. 6.4 Adding Slicers Slicers are visual filter buttons you can click to instantly filter your pivot table. They make your analysis interactive. 1 Click inside the pivot table Click anywhere within the pivot table results. 2 PivotTable Analyze → Insert Slicer In the PivotTable Analyze tab (appears when pivot table is selected), click Insert Slicer. 3 Choose 'type' Tick the 'type' field and click OK. A floating panel appears with buttons for each transaction type. 4 Click the buttons Click 'TRANSFER' on the slicer — the pivot table instantly filters to show only TRANSFER data. Click 'CASH-OUT' to switch. Hold Cmd and click multiple buttons to show several types at once. Chapter 7 Charts and Visualisation Charts turn numbers into pictures. A well-made chart communicates in seconds what a table of numbers takes minutes to absorb. In Excel, charts are always linked to data — if the data changes, the chart updates automatically. 7.1 Bar Chart — Transactions by Type First, create a summary table on a new sheet, then build a chart from it. 1 Create a new sheet Click the + at the bottom to add a sheet. Name it 'Charts'. 2 Type in a summary table In A1 type 'Type', in B1 type 'Count'. Then in A2:A6, type: CASH-IN, CASH-OUT, DEBIT, PAYMENT, TRANSFER. In B2:B6, use COUNTIF formulas: =COUNTIF(Sheet1!B:B,A2) and copy down. 3 Select A1:B6 Highlight the entire table including headers. 4 Insert → Bar Chart Click Insert tab → Bar Chart → Clustered Bar. 5 Move and resize Drag the chart to a nice position. Drag the corner handles to resize it. 6 Add a title Double-click the chart title area and type: Transaction Volume by Type. 7 Format axis labels Right-click the horizontal axis (numbers) → Format Axis → adjust min/max if needed. 7.2 Pie Chart — Fraud vs Legitimate A pie chart is ideal for showing proportions — like what fraction of transactions were fraudulent. 1 Create a 2-row table In a free area, type: Legitimate in one cell, Fraud in the next. Beside each, use COUNTIF to count isFraud=0 and isFraud=1 respectively. 2 Select the 2 labels and 2 numbers Highlight both columns of your 2-row table. 3 Insert → Pie Chart Click Insert → Pie Chart → 2-D Pie. 4 Add data labels Right-click the pie → Add Data Labels. Then right-click the labels → Format Data Labels → tick 'Percentage' and untick 'Value'. 5 Interpret it You will see that fraud is a tiny slice — roughly 0.1-0.2% of all transactions. This is a realistic fraud rate. 7.3 Chart Formatting Best Practices A chart should be immediately understandable to someone who has never seen the data. Follow these rules: • Always include a clear, descriptive title (not just 'Chart 1'). • Label your axes — what are the units? (Count, $, Percentage?) • Use data labels when the exact values matter. • Remove gridlines if they clutter the chart (right-click → delete). • Use consistent colours — if TRANSFER is blue in one chart, keep it blue in all charts. • Never use 3D charts — they distort proportions and make data harder to read. Chapter 8 VLOOKUP and XLOOKUP Lookup functions search for a value in one table and retrieve related information from another column. Think of it like searching a customer ID in a database and getting their name back. This is used constantly in real-world data work. 8.1 VLOOKUP VLOOKUP stands for Vertical Lookup. It looks down a column, finds a match, and returns a value from a specified column to the right. =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) lookup_value: what you are searching for. table_array: the range to search in (must start with the search column). col_index_num: which column number to return from. range_lookup: always use FALSE for exact match. PaySim application — finding transaction details by sender ID: Imagine you have a separate small table on Sheet2 that lists some customer IDs and their names. You want to look up the account name for any transaction. =VLOOKUP(D2, Sheet2!$A:$B, 2, FALSE) Look for the value in D2 (nameOrig) inside Sheet2's column A. When found, return the value from column 2 of that table (the name). FALSE = exact match only. ■■ WATCH OUT VLOOKUP only looks to the RIGHT. The search column must be the leftmost column in your table_array. If you need to look left, use XLOOKUP instead. 8.2 XLOOKUP — The Modern Way XLOOKUP is the newer, more flexible replacement for VLOOKUP. It can look in any direction, has a built-in error message option, and is much easier to write. =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found]) lookup_value: what to search for. lookup_array: where to search (just that one column). return_array: what to return (just that one column). if_not_found: optional message if no match found. =XLOOKUP(D2, Sheet2!A:A, Sheet2!B:B, "Not found") Search for the nameOrig value (D2) in Sheet2 column A. Return the matching value from Sheet2 column B. If not found, show 'Not found' instead of an error. Feature VLOOKUP XLOOKUP Lookup direction Right only Any direction Error handling Needs IFERROR wrapper Built-in if_not_found argument Column reference Number (fragile if columns shift) Direct column reference (robust) Availability All Excel versions Excel 2021 and Microsoft 365 only Chapter 9 Data Cleaning Techniques Real-world data is messy. Even synthetic datasets like PaySim may have inconsistencies. Data cleaning is the process of finding and fixing problems before you analyse anything. Analysts typically spend 60–80% of their time on data cleaning. 9.1 Finding Blank Cells Blanks (empty cells) in a dataset can silently break formulas and pivot tables. Find them before they cause problems. 1 Press Cmd+F Opens the Find dialog. 2 Click 'Options >>' Expand the options. 3 Leave 'Find what' blank Do not type anything in the search box. 4 Tick 'Match entire cell contents' This ensures you find truly empty cells, not cells that happen to have a space. 5 Click Find All Excel lists every blank cell in the sheet. If there are none, the data is complete. Alternatively, use a formula to count blanks in a column: =COUNTBLANK(C:C) Counts how many cells in column C are blank. Example: Returns 0 if the amount column has no missing values 9.2 Removing Duplicates Duplicate rows are a common data quality issue. In PaySim, each transaction should be unique. Let's check and remove any duplicates. 1 Select all data Press Cmd+A to select the entire dataset. 2 Data → Remove Duplicates Click the Data tab → Remove Duplicates button. 3 Choose columns A dialog asks which columns to use to define a 'duplicate'. Tick all columns to find completely identical rows. 4 Click OK Excel removes duplicate rows and tells you how many were removed (if any). In PaySim, there should be 0. 9.3 Checking for Impossible Values In PaySim, some logical checks can reveal data anomalies. For example, after a transaction, the new balance should equal old balance minus amount (for senders). =IF(ABS((E2-C2)-F2)>0.01,"CHECK","OK") E2=oldbalanceOrg, C2=amount, F2=newbalanceOrig. If (oldBalance - amount) does not equal newBalance (within 1 cent), flag it as CHECK. Example: This can reveal accounting errors or data quality issues In PaySim this will actually flag many rows — particularly for PAYMENT and CASH-IN types — because merchant accounts (nameDest starting with M) don't update their balances in the simulation. This is an important finding about data limitations. 9.4 TRIM and CLEAN Text data often has hidden spaces or invisible characters that cause lookups and comparisons to fail silently. =TRIM(text) Removes all leading, trailing, and extra spaces from a text string. Use on name columns. Example: =TRIM(" TRANSFER ") returns "TRANSFER" =CLEAN(text) Removes non-printable characters (invisible characters that sometimes appear in data exported from other systems). Example: =CLEAN(D2) cleans the nameOrig column Chapter 10 Real-World Mini Projects Now you put it all together. Each project below uses multiple skills from previous chapters to answer a real analytical question. Complete each one in order. Project 1: Fraud Summary Dashboard Build a one-page summary sheet that shows the key fraud statistics at a glance. Create a new sheet called 'Dashboard'. Cell Label to type Formula to enter A1 PAYSIM FRAUD ANALYSIS DASHBOARD (just a title, no formula) A3 Total Transactions =COUNTA(Sheet1!B:B)-1 A4 Total Fraud Cases =COUNTIF(Sheet1!J:J,1) A5 Fraud Rate =A4/A3 (format as percentage) A6 Total $ Fraudulently Moved =SUMIF(Sheet1!J:J,1,Sheet1!C:C) A7 Average Fraud Amount =AVERAGEIF(Sheet1!J:J,1,Sheet1!C:C) A8 Largest Single Fraud =MAXIFS(Sheet1!C:C,Sheet1!J:J,1) A9 Fraud Missed by System =COUNTIFS(Sheet1!J:J,1,Sheet1!K:K,0) Format the dollar cells as Currency (Cmd+1 → Currency). Add borders. Make the title bold and large. You now have a professional summary dashboard. Project 2: Top 10 Largest Transactions Find and list the 10 largest transactions in the dataset with all their details. 1 Sort by amount descending In Sheet1, click column C, then Data → Sort Largest to Smallest. 2 Copy the top 10 rows Select rows 2 to 11 (the first 10 data rows after sorting), press Cmd+C. 3 Paste to a new sheet Create a sheet called 'Top10'. Paste with Cmd+V. This is a snapshot — it won't update if data changes. 4 Add analysis In a column beside the data, note: is each transaction fraud? What type is it? Does the balance math check out? ■ WHY ARE WE DOING THIS? The largest transactions are where the biggest risks live. In fraud analysis, regulators and auditors always want to see the largest outliers explained. This is a standard report in financial compliance work. Project 3: Fraud Rate by Transaction Type Build a table showing what percentage of each transaction type is fraudulent. This will reveal which types are most exploited. 1 Create a new sheet Name it 'FraudByType'. 2 List the types In A2:A6, type: CASH-IN, CASH-OUT, DEBIT, PAYMENT, TRANSFER. 3 Count total per type In B2: =COUNTIF(Sheet1!$B:$B,A2) — copy down to B6. 4 Count fraud per type In C2: =COUNTIFS(Sheet1!$B:$B,A2,Sheet1!$J:$J,1) — copy down to C6. 5 Calculate fraud rate In D2: =IFERROR(C2/B2,0) — copy down. Format column D as Percentage. 6 Build a bar chart Select A1:D6 and insert a clustered bar chart comparing total vs fraud counts. 7 Analyse the result You should find fraud only appears in TRANSFER and CASH-OUT — CASH-IN, DEBIT, and PAYMENT have 0 fraud cases. Project 4: Customer Transaction Lookup Tool Build a lookup tool where you type a customer ID and instantly see all their transactions. 1 New sheet: 'Lookup' Create a sheet called Lookup. 2 Input cell In B2, type a customer ID to search for, e.g.: C1231006815 3 Count their transactions In B4: =COUNTIF(Sheet1!D:D,B2) — how many times did this customer send money? 4 Total they sent In B5: =SUMIF(Sheet1!D:D,B2,Sheet1!C:C) — total amount they sent. 5 Were they ever fraudulent? In B6: =COUNTIFS(Sheet1!D:D,B2,Sheet1!J:J,1) — how many of their transactions were fraud? 6 Test with different IDs Change the value in B2 to another customer ID and watch all results update automatically. ■ WHY ARE WE DOING THIS? This is a primitive but functional customer lookup tool — similar in concept to what call centre staff use when a customer calls. Changing one input cell updates every dependent formula. This is the foundation of dynamic Excel models. Chapter 11 Mac Keyboard Shortcuts Speed comes from the keyboard. These shortcuts will save you hours over the course of your studies. On Mac, Ctrl shortcuts from Windows are often replaced by Cmd (■) or different combinations entirely. Navigation Shortcut What It Does Cmd + Home Go to cell A1 Cmd + End Go to last used cell Cmd + → Jump to last cell in the current row Cmd + ↓ Jump to last cell in the current column Cmd + Shift + End Select from current cell to last used cell Ctrl + G Go To dialog — jump to any cell address Selection Shortcut What It Does Cmd + A Select all cells Shift + Click Extend selection to clicked cell Cmd + Shift + Arrow Select to the end of the data in that direction Ctrl + Space Select entire column Shift + Space Select entire row Editing Shortcut What It Does Cmd + Z Undo Cmd + Y Redo Cmd + C Copy Cmd + X Cut Cmd + V Paste Cmd + D Fill down (copies top cell of selection to all selected cells below) Cmd + R Fill right Delete Clear cell contents Cmd + - Delete selected rows or columns Cmd + Shift + + Insert rows or columns Formatting Shortcut What It Does Cmd + 1 Open Format Cells dialog (master formatting) Cmd + B Bold Cmd + I Italic Cmd + U Underline Cmd + Shift + $ Format as Currency Cmd + Shift + % Format as Percentage Cmd + Shift + # Format as Date Option + Enter Start a new line within the same cell Formulas Shortcut What It Does = (equals sign) Start a formula F4 (or Cmd + T) Toggle absolute/relative reference ($) in formula Cmd + Shift + Enter Enter an array formula Cmd + ` Toggle between showing values and showing formulas in cells Shift + F3 Open Insert Function dialog Workbook and Sheets Shortcut What It Does Cmd + N New workbook Cmd + O Open workbook Cmd + S Save Cmd + Shift + S Save As Cmd + W Close workbook Cmd + Page Down / Fn + Cmd + Down Move to next sheet Cmd + Page Up / Fn + Cmd + Up Move to previous sheet You've covered everything. From opening a CSV file to building a fraud analysis dashboard — that is a genuine Excel skillset. The best way to keep improving is to keep asking questions of the data. What types of transactions happen most? Who are the repeat fraudsters? Does the time of day (step) affect fraud rates? Every question is an Excel exercise. Good luck with the MPA. You've got this.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )