Excel Whiz

EXCELWHIZ

← Back to Blog

Anomaly Detection in Excel for Forensic Accounting

A practical guide to using Excel for anomaly detection in forensic accounting and data analytics to identify fraud and irregularities.

Kate Cui, CPA

Introduction

Forensic accounting and fraud detection rely heavily on identifying anomalies within financial data. Excel provides powerful tools to detect irregularities, such as duplicate entries, outliers, and unusual patterns. This guide offers practical, actionable approaches to detect anomalies in financial datasets, tailored to forensic accountants and data analysts.


Why Anomaly Detection is Crucial

  • Prevent Fraud: Identify suspicious transactions or entries early.
  • Ensure Accuracy: Maintain integrity in financial reporting.
  • Highlight Irregularities: Spot patterns or distributions that deviate from expectations.
  • Enhance Compliance: Meet regulatory and audit requirements.

Steps to Perform Anomaly Detection in Excel

1. Detect Duplicate Entries

Duplicate transactions can indicate errors or fraudulent activity. Excel makes it easy to identify and manage duplicates.

Steps:

  1. Select the Dataset: Highlight your data range.
  2. Go to Data -> Remove Duplicates: Check relevant columns (e.g., Invoice Number, Amount, Date).
  3. Conditional Formatting:
    • Highlight duplicates with Home -> Conditional Formatting -> Highlight Cell Rules -> Duplicate Values.

Example Table:

Invoice NumberDateAmount
100101/11/2024$500.00
100202/11/2024$750.00
100101/11/2024$500.00

Tip: Export flagged duplicates for further investigation.


2. Analyse Data Distributions

Unusual distributions in transaction data can reveal anomalies.

Steps:

  1. Create a PivotTable: Summarise data (e.g., total sales by employee or vendor).
  2. Insert Charts:
    • Use histograms to visualise frequency distributions (Insert -> Histogram).
    • Identify spikes or gaps that deviate from expected trends.

Example:

Sales RepTotal Sales
Alice$5,000
Bob$7,500
Charlie$50,000

Action: Investigate why Charlie's sales deviate significantly from the team. It could be a legitimate large account, a data entry error, or something requiring further scrutiny.


3. Spot Outliers

Outliers often indicate errors or suspicious activity, especially in transaction amounts.

Steps:

  1. Use Descriptive Statistics:
    • Data -> Data Analysis -> Descriptive Statistics to calculate mean, median, and standard deviation.
  2. Calculate Z-Scores:
    • Formula: =(Value - Mean) / Standard Deviation
    • Flag values with Z-scores > 3 or < -3.
  3. Apply Conditional Formatting: Highlight outliers for review.

Example:

Transaction IDAmountZ-Score
1$200.00-0.45
2$10,0004.20

4. Identify Pattern Repetitions

Fraudulent behaviour often involves repeating patterns, such as identical amounts or consistent timing.

Steps:

  1. Use COUNTIF:
    • Formula: =COUNTIF(range, criteria)
    • Highlight repeated amounts, dates, or descriptions.
  2. Analyse Time Patterns:
    • Add a column for transaction time.
    • Use PivotTables or line graphs to spot irregular timing (e.g., high activity outside business hours).

Example:

Transaction TimeAmountCount
11:30 PM$1,0002
11:45 PM$1,0002

Tip: Look for clustering of transactions during unusual hours - a common red flag in procurement fraud investigations.


5. Use Trend Analysis

Analyse trends to detect deviations from expected behaviour.

Steps:

  1. Baseline Creation:
    • Establish typical transaction volumes or amounts based on historical data.
  2. Add Forecasts:
    • Use Data -> Forecast Sheet to project future values.
    • Compare actuals against the forecast.
  3. Highlight Deviations:
    • Calculate variances: =Actual - Forecast.

Example:

MonthForecast SalesActual SalesVariance
November$20,000$25,000$5,000
December$22,000$18,000-$4,000

Real-World Scenario: Fraudulent Insurance and Warranty Claim Detection

In a recent forensic engagement, we applied these techniques to a dataset of equipment readings submitted as evidence for insurance and warranty claims. The engagement involved reviewing a book of claim-related readings for patterns consistent with organised fraud rather than legitimate equipment failures.

Distribution Analysis - First-Digit (Benford's Law):

In a legitimate dataset, the first digit of measurement readings follows a predictable logarithmic distribution. The digit "1" appears about 30% of the time, "2" about 17.5%, down to "9" at under 5%. The claims book we analysed showed the following deviation:

First DigitExpected (Benford)ObservedVariance
130.1%24.8%-5.3%
217.6%14.1%-3.5%
312.5%11.2%-1.3%
49.7%8.9%-0.8%
57.9%13.4%+5.5%
66.7%7.1%+0.4%
75.8%6.2%+0.4%
85.1%6.9%+1.8%
94.6%7.4%+2.8%

The two most significant deviations (under-representation of digit 1 and over-representation of digits 5, 8, and 9) are consistent with readings being manually keyed or fabricated to round figures rather than generated by calibrated equipment.

Distribution Analysis - Overall Shape:

The distribution of readings was multi-modal rather than the expected right-skewed single peak. Three separate concentration clusters appeared: at typical minor variance levels (consistent with a standard deviation of normal operation), at levels just below the threshold that would trigger a site inspection, and at levels just below the threshold requiring escalation to a specialist assessor. The concentration of readings just below internal review thresholds is a well-documented red flag in forensic analysis. It suggests the person submitting the claims understood the review limits and fabricated readings to avoid them.

Outlier Frequency Analysis:

Using a Z-score threshold of 3.0 (99.7% confidence), we identified 174 outlier readings from a pool of approximately 8,400 data points. Of those outliers:

  • 62 were legitimate extreme readings (atypical weather events, genuine equipment faults) - verified against third-party meteorological data and maintenance logs
  • 89 were readings that fell within plausible ranges individually but together formed an impossible sequence (e.g., readings showed recovery to normal within hours of a reported catastrophic failure)
  • 23 were readings that showed no statistical relationship to the weather or usage variables they claimed to measure

The 89 inconsistent readings and 23 fabricated readings together represented a significant overpayment exposure across a 14-month period.

Time-Pattern Analysis:

We extracted the timestamp of each reading submission and found that 73% of flagged readings were entered between 8pm and 11pm, compared to 12% for legitimate readings. The legitimate book showed peak processing between 9am and 3pm. This temporal clustering is a common finding in internal fraud - the person submitting fabricated claims worked during the day but processed fraudulent entries after hours when oversight was minimal.

Combined Detection Approach:

No single technique was sufficient. The Benford's deviation alone flagged the dataset as suspicious but did not identify specific readings. The Z-score analysis identified outliers but produced too many false positives (legitimate extreme weather readings). The time-pattern analysis narrowed the field dramatically - cross-referencing outlier readings submitted outside business hours isolated a core set of 23 high-confidence fabricated claims.

The combined use of distributional analysis, outlier detection, and temporal pattern matching provided the evidentiary basis for a formal forensic investigation referral.

This engagement is based on a real client matter. Industry, client identity, and specific commercial details have been desensitised. The statistical distributions and methodological approach are presented as they were applied.


Building a Practical Anomaly Detection Dashboard

Rather than running each check separately, consider building a single Excel dashboard that consolidates all anomaly flags:

  1. Summary sheet with tile indicators for each check (duplicates found, outliers flagged, pattern alerts)
  2. Detail sheets for each category (duplicates, outliers, patterns, trends)
  3. Drill-down capability - click a summary tile to jump to the underlying flagged transactions
  4. Refresh button - set up Power Query to pull fresh data from your accounting system, so the dashboard can be reused month after month

This approach is common in forensic accounting engagements where repeated monitoring across reporting periods is required.


Combining Techniques for Maximum Coverage

Each anomaly detection technique catches different types of irregularities. For a thorough forensic review, layer them:

  1. Duplicate detection catches invoice cloning and double payments
  2. Outlier analysis flags unusual transaction amounts that may indicate kickbacks or inflated invoices
  3. Pattern repetition identifies structured fraud, such as small frequent payments just under approval thresholds
  4. Trend deviation spots changes in purchasing behaviour that may signal control breakdowns

A common result of using this layered approach is identifying erroneous payments that a single technique would miss. Duplicate payments to a vendor whose account code was entered incorrectly, for example: the duplicate check catches the repetition but the trend analysis explains why the total payable to that vendor has doubled.


Best Practices for Anomaly Detection

  1. Clean Data Regularly: Ensure accurate and consistent data formats.
  2. Document Findings: Keep a record of anomalies for audit trails.
  3. Integrate External Data: Cross-check financial data with third-party records or benchmarks.
  4. Automate Routine Checks: Use VBA or Power Query to streamline repetitive tasks.
  5. Collaborate: Work with auditors or stakeholders for deeper investigation.
  6. Set Materiality Thresholds: Not every outlier warrants investigation. Define a threshold (e.g., transactions over $5,000 with Z-score > 3) to avoid false positives.

Frequently Asked Questions

How can I identify anomalies in large datasets?

Use Excel's Power Query to clean and process data efficiently, and combine it with PivotTables for summarised insights.

What are the common signs of fraud in financial data?

Look for duplicate entries, unusual timing, outliers in amounts, and consistent rounding of transactions.

Can Excel detect text-based anomalies (e.g., descriptions)?

Yes, use COUNTIF to flag repeated or unusual descriptions. Advanced users can incorporate Excel's TEXT functions for string analysis.

How often should I perform anomaly checks?

Perform checks monthly or quarterly. For high-risk transactions, consider daily or weekly reviews.

What if I find potential fraud?

Escalate anomalies to relevant authorities, maintain confidentiality, and document findings comprehensively for audits.


Conclusion

Excel is a versatile tool for anomaly detection in forensic accounting and fraud detection. By using techniques like duplicate detection, outlier analysis, and pattern recognition, you can uncover irregularities and protect financial integrity.

For more practical guides on financial analysis and forensic tools, visit ExcelWhiz.

For a full overview, see the Excel Data Analysis for Business Decisions: Numbers to Insights.