VOOZH about

URL: https://www.geeksforgeeks.org/python/python-arithmetic-operations-in-excel-file-using-openpyxl/

⇱ Python | Arithmetic operations in excel file using openpyxl - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | Arithmetic operations in excel file using openpyxl

Last Updated : 11 Jul, 2025

Prerequisite: Reading & Writing to excel sheet using openpyxl
Openpyxl is a Python library using which one can perform multiple operations on excel files like reading, writing, arithmetic operations and plotting graphs. Let's see how to perform different arithmetic operations using openpyxl. 
 

  • =SUM(cell1:cell2) : Adds all the numbers in a range of cells. 
     

  • Output: 
     
👁 Image
  • =PRODUCT(cell1:cell2) : Multiplies all the numbers in the range of cells.
     

  • Output: 
     
👁 Image
  • =AVERAGE(cell1:cell2) : It gives the average (arithmetical mean) of all the numbers which is present in the given cell range.
     

  • Output: 
     
👁 average
  • =QUOTIENT(num1, num2) : It returns the integer portion of a division.
     

  • Output: 
     
👁 quotient
  • =MOD(num1, num2) : Returns the remainder after a number is divided by the divisor.
     

  • Output: 
     
👁 modulus
  • =COUNT(cell1:cell2) : It counts the number of cells in a range that contain the number.
     

  • Output: 
     
👁 Image


 

Comment
Article Tags: