MF Portfolio Analyzer: Holdings Change Analysis

Compare what a set of mutual funds held in two months: which companies they added, cut or exited. ISIN name standardization with human-in-the-loop corrections, in Excel with xlwings Lite.

Download Excel (.xlsx) Watch Video Guide

What This App Does

#

A pipeline for analyzing mutual fund portfolio holdings across two months:

  • File import in Python: reads every converted .txt / .csv / .pipe file in a folder, detects the delimiter, skips duplicate fund-months and logs each file
  • Built-in sample data: 5 mid-cap funds, May and Aug 2025, to try every step before using your own files
  • 2-period detection: uses the latest two months found in the data
  • Automatic ISIN name standardization, with exceptions flagged for review
  • Validation totals per fund and month
  • Human-in-the-loop correction workflow
  • Summary across all funds, plus a company-by-fund view (New / Exited / Held)
  • Top 10 holdings charts

Important Note

Your own files must first be converted to standardized text files with the MF File Converter. The sample data needs no conversion.

How to Use

#
  1. Download & open: get the workbook and open xlwings Lite (Home > Add-ins). The HOW_IT_WORKS sheet explains every step; the buttons are on the CONTROL sheet.
  2. Quick start: click "1b. Use Sample Data", then "2. Stage 1", then "3. Stage 2"
  3. Your own files: convert each fund's monthly disclosure with the MF File Converter (one file per fund per month), upload them under Files > Import/Export in xlwings Lite (or mount a local folder and enter its path on CONTROL), then click "1a. Import Your Files"
  4. Run Stage 1: review the ISIN_MAPPING sheet; rows with exception_tag = 1 need a look
  5. Manual correction: edit standardized_name_display so each company has one name
  6. Run Stage 2: rebuilds the outputs with your corrected names
  7. View results: SUMMARY, HOLDINGS_BY_FUND and CHART_TOPHOLD

How It Works

#

A 3-step workflow for data quality and accuracy:

Import

  • Python import, no macros: reads every converter file in the import folder (default /data)
  • Checks the required columns, skips a fund-month already imported, writes IMPORT_LOG
  • 2-period detection: identifies the latest two months automatically

ISIN Standardization

  • Handles name variations (HDFC, HDFC Bank Ltd, etc.)
  • Selects the best name for each ISIN
  • Flags names that may be one company under different names, or different companies with similar names

Human-in-the-Loop

  • VALIDATIONS: market value and quantity totals per fund and month, to check against the fund's own disclosure
  • User edits ISIN_MAPPING for accuracy
  • Stage 2 uses the corrected mappings

Resources

xlwings Lite

Built with xlwings Lite

Created by Felix Zumstein, it brings Python into Excel seamlessly - enabling native support for databases, AI agents, LLMs, advanced analytics, ML, APIs, and complete automation workflows.

Bugs,issues,questions? Drop a note: amar@harolikar.com