Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using DSum in Excel

Posted on 2000-04-24
6
Medium Priority
?
845 Views
Last Modified: 2012-08-14
I have a spreadsheet with a large number of records.  These were taken down from a database.  The numbers unfortunately have duplicated.  One list shows part Numbers and a further field shows quantities.  I have been advised to use dsum to get rid of the the duplicate numbers and to add the quantities.  I find the online help files defeat me and am lost how to use this function or even am unsure if it is the correct way to do this.  Can anyone help
0
Comment
Question by:martin_mcginn
6 Comments
 
LVL 4

Expert Comment

by:Noggy
ID: 2743961
Hmm, I wouldn't use DSum for this. Instead, use Data|Filter|Advanced Filter:
1. To remove duplicates, select the table (all of the fields and the column headers and the data).
2. Goto Data|Filter|AdvancedFilter in the Excel menu.
3. Check the Unique Records Only checkbox.
4. Select Copy to another location.
5. Put your insertion point in the Copy To textbox.
6. Select a cell ON THE SAME SHEET where you want the data to go. Note that the cell must not be in the source table.
7. Press OK.
8. You will now only have unique records.

I think this is what you want. If not, can you define a bit more the structure of the data table and in which fields the duplicates are in?
0
 

Author Comment

by:martin_mcginn
ID: 2745446
The data I have are a large number of purchasing records.  Each time an article was purchased the table shows the article number together with the quantity purchased   Unfrotunately whenever further stock was purchased it repeats the Article number and all the other unique information o/n etc.  I want to be able to list an article number and the total quantity bought and it is driving me around the twist.
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 400 total points
ID: 2745723
If it's a once off exercise, you could import the data into Access, write a group-by query for the article number and DSUM the other values and export it back to excel.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 4

Expert Comment

by:Noggy
ID: 2746715
Aah, so they're not really duplicate numbers in the field that you want to sum (quantity purchased). You can ignore(or delete) all the other repeated fields and just basically look at your Article Number and Quantity Purchased fields. Hence the DSUM.

Ok, so here it is. If you have the following data in a spreadsheet, with the headers in row 1 and the data starting at row 2:
Col A                            Col B                                              Col C
Article Number      Quantity Purchased            Article Number
1                                      50                                           2
2                                      60            
3                                      70            
1                                      80            
2                                      90            
3                                      100            

$C$1 = The Header of the field that the criteria need to match.
$C$2 = The criteria match value

For your DSUM, you need:
=DSUM($A$1:$B$7,$B$1,C1:C2)
Returns the value 150

where:
$A$1:$B$7 = All the table that you want the DSUM to apply to. This should include at least the field that you want to sum and the field that the criteria is to apply to.
$B$1 = Either the label of the column in double quotation marks or a number that represents the column's position in the list. Here I have used the former.
C1:C2 = The Criteria cells containing the conditions for the Sum. The range must include a column label (the same as in the table)  and, one cell below that,  the value for the condition.

Nico's suggestion is also good too. I would use that unless this data is going to be continually coming in in this horrible format.
0
 

Expert Comment

by:DrewD1
ID: 2748466
How about a pivot table?
You can select the item number and the quantity, as well as the headers for bot columns.
Then under the data menu, select Pivot Table.
Your data source is the current excel file, and you can output to a new sheet or the same one.  for the layout. you can make the row equal to the item number and drag the quantity to the dat section. It shopuld automatcially create it as a sum. the resulting pivot table should be what you are looking for.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 2748806
Nice to know this did the trick !

Success.

Nico
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question