← All tutorials

Python in Excel tutorial

Compare Two Tables and Find Mismatches

Compare two Excel tables with Python in Excel, identify missing records, and calculate differences using pandas.

Python in ExcelExcel · Python · Reconciliation
Python in Excel reconciliation tutorial thumbnail

About this tutorial

Reconcile two tables with pandas

This tutorial uses Python in Excel to group and compare two datasets, keep records that exist on only one side, and calculate value differences.

It is a compact pattern that can be reused for accounting reconciliations and other data-quality checks.

01

Prepare both tables

Read the Excel tables into Python and aggregate the values by the reconciliation key.

02

Merge the datasets

Use an outer merge so missing records on either side remain visible.

03

Focus on mismatches

Calculate the difference and filter the result to the items that need attention.