What is DPRODUCT function in Excel?
The DPRODUCT function is one of the Database functions of Excel.
It multiplies the values in the field (column) records in the database that match the specified conditions.
We can find this function in Database of insert function Tab.
How to use DPRODUCT function in excel
- Click on an empty cell (like F5 )

2. Click on the fx icon (or press shift+F3)

3. In the insert function tab you will see all functions

4. Select Database category
5. Select DPRODUCT function
6. Then select ok

7. In the function arguments Tab you will see DPRODUCT function
8. In the Database section you can enter the range of cells that makes up the list or database. A database is a list of related data (ex: Table1)
9. Field section is either the label of the column in double quotation marks or a number that represents the column’s position in the list
10. Criteria section is the range of cells that contains the conditions you specify. The range includes a column label and one cell below the label for a condition (ex: Table1)
11. You will see the result in formula result section

Examples of DPRODUCT function in excel
Python code for DPRODUCT function
Name | Age | Height | Weight |
Olivia | 25 | 210 | 180 |
Noah | 25 | 205 | 235 |
Oliver | 27 | 195 | 205 |
Elijah | 22 | 198 | 185 |
James | 29 | 199 | 231 |
William | 29 | 201 | 240 |
Benjamin | 21 | 202 | 235 |
Lucas | 25 | 200 | 238 |
Henry | 22 | 204 | 190 |
import math
import pandas as pd
data=pd.read_csv(‘nba.csv’)
df = pd.DataFrame(data)
condition=df.loc[lambda df: (df[‘Age’] >27 )*(df[‘Height’]>198)] product_Weight=math.prod(condition[‘Weight’])
print(product_Weight