|
|
The Excel DSUM Function
Excel Database Functions
The Excel Database Functions are included to assist you when working with an Excel database. This typically takes the form of a large table of data, where each row in the table stores an individual record. Each column in the spreadsheet table stores a different field (or type of information) for each record. The database functions perform basic operations, such as count, max, min, etc, but they enable the user to specify criteria, so that the operation is performed on selected records only. Other records in the database are ignored. Basic DescriptionThe Excel Dsum function calculates the sum of a field (column) in a database for selected records, that satisfy user-specified criteria. The function is very similar to the Excel Sumifs function, which is new to Excel 2007. The syntax of the Excel Dsum function is :
DSUM( database, field, criteria )
where the arguments are:
Wildcards
You can also use the following wildcards in text-related criteria:
? - matches any single character
* - matches any sequence of characters if you do actually want to find the ? or * character, type the ~ symbol before this character in your search. eg. the condition "A*e" will match all cells containing a text string beginning with "A" and ending in "e". The criteria supplied beneath each field heading can be either:
Note that the Excel database functions are not case sensitive. So, for example, the criteria ="South" will be satisfied by cells containing the text "South" or "south". Excel Dsum Function Examples
The following examples are based on the simple database on the right, which stores the sales figures for four sales representatives, working in the North or South area, over the four quarters of a year. Example 1In the example below, the Dsum function is used to calculate the total sales in quarters 3 & 4, in the "North" area. The criteria are specified in cells F1 - G2 and the Dsum formula is shown in cell F3.
The above Dsum function calculates the sum of the values in cells D10, D11, D14 & D15, and therefore returns the value $1,210,000 Example 2In the example below, the Dsum function is used to calculate the total sales in quarter 3, by sales reps with names beginning with the letter "C". Again, the criteria are specified in cells F1 - G2 and the Dsum formula is shown in cell F3.
The above Dsum function sums the values in cells D11 and D12 and so returns the value $710,000 Note that, in the above two examples, instead of typing in "Sales" for the Field argument, we could have simply used the number 4 (to denote the 4th column of the database). Further examples of the Excel Dsum function can be found on the Microsoft Office website. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Copyright © 2008-2011 ExcelFunctions.net |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||