Use Google Sheets DPRODUCT function to get the product of values in a column in a database, based on or more criterion. The DPRODUCT function in Google Sheets has three attributes. These are the database, field, and criteria.
Before you use the DPRODUCT function, create a criteria range. Its headers should be same as the headers of the database.
Here is the format of the DPRODUCT function:
=DPRODUCT(database, field, criteria)
Database - specify the range
Field - specify the column with values whose product you want to get
Criteria - specify the condition to multiply only specific values
Let's consider an example. Say there is a database of aptitude
test scores, number of students with a particular score or within a score range, fee for a program, and discount in fee based on the test score. The headers of the database are Score, Fee Data, and Value.
Assume that you want to find out the total fee received from students, say with a score of 500 on the aptitude test. In the cell below the Score header in the database range, type 500.
In the criteria range, in the cell under the Score header, type 500. Type the Google Sheets
DPRODUCT function in a cell. Let's say the database range is A1:C8, the column with the values is C1. and the criteria range is E1:G2.
The DPRODUCT function for the above data is:
=DPRODUCT(A1:C8, C1, E1:G2)
Type the above formula in a cell and press Enter. The DPRODUCT function in Google Sheets will return the product of the values in column C1 matching the criterion specified in the criteria range.
Now, if you want to get the total fee received from students, say with a score in the range 450 to 499, all you have to do is to type 450-459 in the cell under the Score header in the criteria range and press enter. This criterion, of course, should be exactly same in the database too.
Do take a look at this Google Sheets DFUNCTION tutorial, which illustrates this function with an example.