Solved

Using DSum in Excel

Posted on 2000-04-24
6
837 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 100 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Outlook Free & Paid Tools
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 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