IRONSOFTWAREHOME
Aggregate Excel Functions
from ironxl import *

# Load existing spreadsheet
workbook = WorkBook.Load("sample.xls")
worksheet = workbook.WorkSheets[0]

# Get range from the worksheet
selected_range = worksheet["A1:A8"]

# Apply sum of all numeric cells within the range
sum_ = selected_range.Sum()

# Apply average value of all numeric cells within the range
avg = selected_range.Avg()

# Identify maximum value of all numeric cells within the range
max_ = selected_range.Max()

# Identify minimum value of all numeric cells within the range
min_ = selected_range.Min()
pip install ironxl
Aggregate Excel Functions

Aggregate Excel Functions

The code example above shows how to retrieve aggregate values from a range of cells in an Excel spreadsheet using IronXL for Python. Note that any non-numerical cell in the selected range will be excluded from the calculation.

Sum

The Sum() method returns the total sum of all numeric values in the selected range of cells.

Average

The Average() method returns the arithmetic mean of all numeric values in the selected range of cells.

Minimum

The Min() method returns the smallest numeric value among the cells in the selected range.

Maximum

The Max() method returns the largest numeric value among the cells in the selected range.

For greater flexibility, all of the above functions can also be applied to individual rows or columns. Learn more about selecting rows and columns.

Explore Math Functions in Excel Using Python

Ready to Get Started?

Version:2026.10just released

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronXL for Python
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Python Module Download for Excel
Install with pip

Version: 2026.10

  1. Download and install Python 3.7+.
  2. Install pip from pypi.org if it isn't installed already.
  3. Execute the above command in the terminal.
Python PDF Module
Download Module

Version: 2026.10

Manually install into your project

  1. Download the package
  2. Run this command from the terminal
    pip install IronXL-2026.10-py37-none-win_amd64.whi

Licenses from $999