Part 5B - Excel Automation and Analysis Using ChatGPT Scripts

Author

Yahya Nazer

Published

2026.06.18

Part 5B - Excel Automation and Analysis Using ChatGPT Scripts

Chapters

  1. Writing Excel Files
  2. Excel File Selection GUI
  3. Excel Viewer
  4. Excel Statistics

Purpose

Learn how to use ChatGPT to generate Python programs that create, analyze, and display Excel data.

Standard Workflow

Business Problem → ChatGPT Script → Generated Python Program → Test → Improve Script → Improve Program

Chapter 5 - Writing Excel Files

Program: Write-Excel.py

Topics:

  • pandas DataFrame
  • to_excel()
  • openpyxl
  • Multiple worksheets
  • Formatting basics

Example Tasks:

  • Create Employees.xlsx
  • Create Sales.xlsx
  • Save reports to C-Results

Chapter 6 - Excel File Selection GUI

Program: Select-Excel-File-GUI.py

Features:

  • Select Excel file
  • Display selected path
  • Log window
  • Status messages
  • Mac-friendly GUI

Topics:

  • tkinter
  • filedialog
  • labels
  • buttons

Chapter 7 - Excel Viewer

Program: Excel-Viewer.py

Features:

  • Select Excel file
  • Display worksheet names
  • Show row count
  • Show column count
  • Display sample records

Topics:

  • pandas
  • openpyxl
  • tkinter

Chapter 8 - Excel Statistics

Program: Excel-Statistics.py

Features:

  • Row count
  • Column count
  • Missing values
  • Unique values
  • Numeric summaries

Statistics:

  • Minimum
  • Maximum
  • Average
  • Median

Part 5B Review

Skills Checklist

  • Write Excel files
  • Use openpyxl
  • Build Excel GUI tools
  • Display workbook information
  • Generate statistics
  • Improve ChatGPT scripts

Looking Ahead

Part 5C covers:

  • Data Validation
  • Data Cleaning
  • Combining Excel Files
  • Excel Reports