Home / Formula Types / Database / Dsum

Formula generator for DSUM function

The DSUM function returns the sum of values selected from a database table-like array or range using a SQL-like query. It takes three arguments: database (the range that represents the database table), field (the column or range containing the values to be summed), and criteria (the SQL-like query that specifies the conditions for selecting the values to be summed). The criteria can include logical operators, comparison operators, and functions to filter the data. DSUM is useful for performing calculations on specific subsets of data within a larger dataset.

Formula generator

Spreadsheet AI is the #1 AI for generating and comprehending Excel and Google Sheets formulas. With its advanced capabilities, it goes beyond the basics by providing support for VBA and custom tasks. Streamline your spreadsheet with Spreadshee AI

Product Demo

How to generate an DSUM formula using AI.

To obtain information on the ARRAY_CONSTRAIN formula, you could ask the AI chatbot the following question: “To obtain the DSUM formula for your data, you can ask the AI chatbot the following question: "What formula can I use in Excel to calculate the sum of a specific column in a table based on certain criteria?"

DSUM formula syntax

The DSUM function in Excel is used to calculate the sum of a range of values in a database that meet specific criteria. The syntax for DSUM is as follows: DSUM(database, field, criteria) - database: This is the range of cells that makes up the database, including the column headers. - field: This specifies the column or field from which the sum should be calculated. - criteria: This is a range of cells that contains the criteria for selecting the records to include in the sum. The DSUM function will sum up the values in the specified field that meet the criteria specified in the criteria range. It is important to ensure that the criteria range has the same structure as the database range, with column headers matching the field names. For example, if you have a database range A1:D10, with column headers in the first row, and you want to sum up the values in the "Sales" column for records where the "Region" is "North", you can use the following formula: =DSUM(A1:D10, "Sales", A1:D2) This formula will calculate the sum of the "Sales" values in the database range A1:D10, only including the records where the "Region" is "North" (based on the criteria range A1:D2).

Use Cases & Examples

In these use cases, we use the DSUM formula to calculate the sum of values in a database based on specified criteria. The DSUM function allows us to specify a database range, criteria range, and criteria conditions to calculate the sum of values that meet the specified criteria.

Sales Total


Calculates the total sales amount from a database table-like array based on specified criteria.


DSUM(A1:E10, F1, "C1:C10>=DATE(2022,1,1)")

Inventory Value


Calculates the total value of inventory items from a database table-like array based on specified criteria.


DSUM(A1:E10, G1, "D1:D10=""Electronics""")

Employee Salary


Calculates the total salary amount of employees from a database table-like array based on specified criteria.


DSUM(A1:E10, H1, "B1:B10=""Manager""")

AI tips

Enhance Your Excel Efficiency with AI Tips: Discover our innovative Excel add-in feature, ‘AI Tips.’ Streamline your workflow and boost productivity as AI-powered suggestions offer real-time insights for optimal spreadsheet organization, data analysis, and visualization. Elevate your Excel experience with intelligent recommendations tailored to your unique needs, helping you work smarter and achieve more.

Provide Clear Context

When describing your requirements to the AI, provide clear and concise context about the data you have, the specific task you want to accomplish, and any relevant constraints or conditions. This helps the AI understand the problem accurately.

Include Key Details

Include important details such as column names, data ranges, and specific criteria that need to be considered in the formula. The more precise and specific you are, the better the AI can generate an appropriate formula.

Use Examples

If possible, provide examples or sample data to illustrate the desired outcome. This can help the AI better understand the pattern or logic you are looking for in the formula.

Mention Desired Functionality

Clearly articulate the functionality you want the formula to achieve. Specify if you are looking for lookups, calculations, aggregations, or any other specific operations.


Frequently Asked Questions

  • The DSUM function is used to calculate the sum of values from a database that meet specified criteria.
  • The DSUM function requires three arguments: the database range, the field to sum, and the criteria range.
  • To use the DSUM function, select a cell where you want the result to appear, enter the function as =DSUM(database, field, criteria), and provide the necessary ranges for the arguments.
  • Yes, you can use DSUM with multiple criteria by specifying the criteria range as a table with multiple columns, each representing a different criterion.
  • If no matching records are found, the DSUM function will return a #VALUE! error.