Solved

Excel Formula -DSum formula

Posted on 2013-06-18
8
347 Views
Last Modified: 2013-06-25
Hi, I am using a DSUM formula to add the amounts from CompanyA if it matches Cell A1 and A2. How can I modify the formula so that it only adds the amounts if the amouts are positive ? Below is a sample. On the last row I have the formula that I am using.

    A                             C                D              E           F  
1CmbGrp                  Current            Want
2US                              
3            CmbGrp      CompanyA            
4                  100            
5            US      300            
6                  -200            
7                  300            
8            US      -100            
9Total Positive US $                  200            300
10                              
11                              
12            DSUM(D3:E8,2,A1:A2)
0
Comment
Question by:Conernesto
  • 4
  • 4
8 Comments
 
LVL 24

Expert Comment

by:Steve
ID: 39256967
Could you post in a dummy workbook.

Have you considered SUMIFS (2007+) or SUMPRODUCT (2003&Earlier)

Attached example shows simple use of >0 for positive sum.
Example.xlsx
Example.xls
0
 

Author Comment

by:Conernesto
ID: 39256994
Attached is a dummy workbook. The answer that I want in cell D9 is 300

conernesto
Dsum.xlsx
0
 
LVL 24

Expert Comment

by:Steve
ID: 39256999
Here you go.. with 2 possibilities...

=DSUM(C3:D8,2,A1:B2)
With new criteria in B1:B2

=SUMIFS(D3:D8,C3:C8,A2,D3:D8,B2)
No need for criteria headings and not  such a rigid structure as DSUM
Dsum.xlsx
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Conernesto
ID: 39257024
This looks like it will work. I will close this question after I try on my worksheet.

Thank you.

conernesto
0
 
LVL 24

Expert Comment

by:Steve
ID: 39257044
You can replace the cell reference to the greater than zero with ">0" (including quotation marks) in the SUMIFS
0
 

Author Comment

by:Conernesto
ID: 39257375
Do I replace  ">0" in the formula? If yes, how?
0
 
LVL 24

Accepted Solution

by:
Steve earned 500 total points
ID: 39257454
The formula would become:

=SUMIFS(D3:D8,C3:C8,A2,D3:D8,">0")

or
=SUMIFS(D3:D8,C3:C8,"US",D3:D8,">0")
Dsum.xlsx
0
 

Author Comment

by:Conernesto
ID: 39257461
OK
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

772 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