Sum based on multiple conditions

I have Column A with a "stage" in it that will range from 1 - 8
I have column B with a "close date" in it that could be any date
I have column C with a value in it.

I need the sum of the values in C that have Close dates in any given range 
(ex. 10/1/2004 through 10/31/2004), that are in any given sales stage.

I tried using SUMIF which seems to only work with 1 condition...so I can do 
=SUMIF(AA,1,CC) and it will give me the sum of the values that are in stage 
1.  SUMIF doesn't appear to work with ranges or multiple conditions though.
0
csheldon (1)
9/3/2004 2:33:02 PM
excel.misc 78881 articles. 5 followers. Follow

6 Replies
460 Views

Similar Articles

[PageSpeed] 1

=SUMPRODUCT((C1:C100>="10/1/2004")*(C1:C100<="10/31/2004")*(A1:A100=7)*(C1:C
100))
Bob Umlas
Excel MVP

"csheldon" <csheldon@discussions.microsoft.com> wrote in message
news:805DE57E-53A7-4F9F-90CB-219A8B0C4898@microsoft.com...
> I have Column A with a "stage" in it that will range from 1 - 8
> I have column B with a "close date" in it that could be any date
> I have column C with a value in it.
>
> I need the sum of the values in C that have Close dates in any given range
> (ex. 10/1/2004 through 10/31/2004), that are in any given sales stage.
>
> I tried using SUMIF which seems to only work with 1 condition...so I can
do
> =SUMIF(AA,1,CC) and it will give me the sum of the values that are in
stage
> 1.  SUMIF doesn't appear to work with ranges or multiple conditions
though.


0
rumlas (268)
9/3/2004 2:41:33 PM
Assuming that your data starts in the second row...

=SUMPRODUCT(--(A2:A100=D2),--(B2:B100>=E2),--(B2:B100<=F2),C2:C100)

....where D2 contains the stage of interest, E2 the lower date boundary, 
and F2 the higher date boundary.  Adjust the range accordingly.

Hope this helps!

In article <805DE57E-53A7-4F9F-90CB-219A8B0C4898@microsoft.com>,
 "csheldon" <csheldon@discussions.microsoft.com> wrote:

> I have Column A with a "stage" in it that will range from 1 - 8
> I have column B with a "close date" in it that could be any date
> I have column C with a value in it.
> 
> I need the sum of the values in C that have Close dates in any given range 
> (ex. 10/1/2004 through 10/31/2004), that are in any given sales stage.
> 
> I tried using SUMIF which seems to only work with 1 condition...so I can do 
> =SUMIF(AA,1,CC) and it will give me the sum of the values that are in stage 
> 1.  SUMIF doesn't appear to work with ranges or multiple conditions though.
0
domenic22 (716)
9/3/2004 2:49:31 PM
Hi
you probably have to adapt the ranges. In what columns are your date
values, etc.

--
Regards
Frank Kabel
Frankfurt, Germany


csheldon wrote:
> Hmm....This always returns "0"  its not summing the values in C.
>
> I tried it with and without the quotes around the dates
>
>
> "Bob Umlas" wrote:
>
>>
=SUMPRODUCT((C1:C100>="10/1/2004")*(C1:C100<="10/31/2004")*(A1:A100=7)*
(C1:C
>> 100))
>> Bob Umlas
>> Excel MVP
>>
>> "csheldon" <csheldon@discussions.microsoft.com> wrote in message
>> news:805DE57E-53A7-4F9F-90CB-219A8B0C4898@microsoft.com...
>>> I have Column A with a "stage" in it that will range from 1 - 8
>>> I have column B with a "close date" in it that could be any date
>>> I have column C with a value in it.
>>>
>>> I need the sum of the values in C that have Close dates in any
>>> given range (ex. 10/1/2004 through 10/31/2004), that are in any
>>> given sales stage.
>>>
>>> I tried using SUMIF which seems to only work with 1 condition...so
>>> I can do =SUMIF(AA,1,CC) and it will give me the sum of the values
>>> that are in stage
>>> 1.  SUMIF doesn't appear to work with ranges or multiple conditions
>>> though.

0
frank.kabel (11126)
9/3/2004 4:19:17 PM
Hi
whyt is the exact formula you have used?. Note: you can use ranges such
as C:C

--
Regards
Frank Kabel
Frankfurt, Germany


csheldon wrote:
> Thanks for trying but it returns #Num error.  Any ideas?
>
> -Cliff
>
>
> "Domenic" wrote:
>
>> Assuming that your data starts in the second row...
>>
>> =SUMPRODUCT(--(A2:A100=D2),--(B2:B100>=E2),--(B2:B100<=F2),C2:C100)
>>
>> ....where D2 contains the stage of interest, E2 the lower date
>> boundary, and F2 the higher date boundary.  Adjust the range
>> accordingly.
>>
>> Hope this helps!
>>
>> In article <805DE57E-53A7-4F9F-90CB-219A8B0C4898@microsoft.com>,
>>  "csheldon" <csheldon@discussions.microsoft.com> wrote:
>>
>>> I have Column A with a "stage" in it that will range from 1 - 8
>>> I have column B with a "close date" in it that could be any date
>>> I have column C with a value in it.
>>>
>>> I need the sum of the values in C that have Close dates in any
>>> given range (ex. 10/1/2004 through 10/31/2004), that are in any
>>> given sales stage.
>>>
>>> I tried using SUMIF which seems to only work with 1 condition...so
>>> I can do =SUMIF(AA,1,CC) and it will give me the sum of the values
>>> that are in stage
>>> 1.  SUMIF doesn't appear to work with ranges or multiple conditions
>>> though.

0
frank.kabel (11126)
9/3/2004 4:19:44 PM
Hi
as said the first formula can't work as range such as E:E are not
allowed in SUMPRODUCT. It would be helpful if you could explain what is
in each column in your sheet

--
Regards
Frank Kabel
Frankfurt, Germany


csheldon wrote:
> Hi,
>
> This is domeniks formula adapted to my sheet:
>
> =SUMPRODUCT(--(E:E=4),--(F:F>="10/1/2004"),--(F:F<="10/31/2004"),Q:Q)
>
> This is your formula adapted to my sheet:
>
>
=SUMPRODUCT((F2:F1000>=10/1/2004)*(F2:F1000<=10/31/2004)*(E2:E1000=4)*(
Q2:Q1000))
>
> I've tried the both, with and without quotes around the dates.
>
> Does it matter that the values in Q are derived by another sum? ex
> =SUM(O55:P55)
>
> -Cliff
>
>
>
> "Frank Kabel" wrote:
>
>> Hi
>> whyt is the exact formula you have used?. Note: you can use ranges
>> such as C:C
>>
>> --
>> Regards
>> Frank Kabel
>> Frankfurt, Germany
>>
>>
>> csheldon wrote:
>>> Thanks for trying but it returns #Num error.  Any ideas?
>>>
>>> -Cliff
>>>
>>>
>>> "Domenic" wrote:
>>>
>>>> Assuming that your data starts in the second row...
>>>>
>>>>
=SUMPRODUCT(--(A2:A100=D2),--(B2:B100>=E2),--(B2:B100<=F2),C2:C100)
>>>>
>>>> ....where D2 contains the stage of interest, E2 the lower date
>>>> boundary, and F2 the higher date boundary.  Adjust the range
>>>> accordingly.
>>>>
>>>> Hope this helps!
>>>>
>>>> In article <805DE57E-53A7-4F9F-90CB-219A8B0C4898@microsoft.com>,
>>>>  "csheldon" <csheldon@discussions.microsoft.com> wrote:
>>>>
>>>>> I have Column A with a "stage" in it that will range from 1 - 8
>>>>> I have column B with a "close date" in it that could be any date
>>>>> I have column C with a value in it.
>>>>>
>>>>> I need the sum of the values in C that have Close dates in any
>>>>> given range (ex. 10/1/2004 through 10/31/2004), that are in any
>>>>> given sales stage.
>>>>>
>>>>> I tried using SUMIF which seems to only work with 1
condition...so
>>>>> I can do =SUMIF(AA,1,CC) and it will give me the sum of the
values
>>>>> that are in stage
>>>>> 1.  SUMIF doesn't appear to work with ranges or multiple
>>>>> conditions though.

0
frank.kabel (11126)
9/3/2004 5:15:16 PM
You need to coerce the date constants between the double quotes:

=SUMPRODUCT((C1:C100>="10/1/2004"+0)*(C1:C100<="10/31/2004"+0)*(A1:A100=7)*(
C1:C100))

or equivalently: switch to the comma syntax with the conditionals coerced
using double negation...

=SUMPRODUCT(--(C1:C100>="10/1/2004"+0),--(C1:C100<="10/31/2004"+0),--(A1:A10
0=7),C1:C100)

"csheldon" <csheldon@discussions.microsoft.com> wrote in message
news:444F9743-B774-4C34-9872-8AF2D2D5FBA5@microsoft.com...
> Hmm....This always returns "0"  its not summing the values in C.
>
> I tried it with and without the quotes around the dates
>
>
> "Bob Umlas" wrote:
>
> >
=SUMPRODUCT((C1:C100>="10/1/2004")*(C1:C100<="10/31/2004")*(A1:A100=7)*(C1:C
> > 100))
> > Bob Umlas
> > Excel MVP
> >
> > "csheldon" <csheldon@discussions.microsoft.com> wrote in message
> > news:805DE57E-53A7-4F9F-90CB-219A8B0C4898@microsoft.com...
> > > I have Column A with a "stage" in it that will range from 1 - 8
> > > I have column B with a "close date" in it that could be any date
> > > I have column C with a value in it.
> > >
> > > I need the sum of the values in C that have Close dates in any given
range
> > > (ex. 10/1/2004 through 10/31/2004), that are in any given sales stage.
> > >
> > > I tried using SUMIF which seems to only work with 1 condition...so I
can
> > do
> > > =SUMIF(AA,1,CC) and it will give me the sum of the values that are in
> > stage
> > > 1.  SUMIF doesn't appear to work with ranges or multiple conditions
> > though.
> >
> >
> >


0
akyurek (248)
9/3/2004 11:31:14 PM
Reply:

Similar Artilces:

How to perform sum sum sum...
How to perform sumation within that particular item but the item is not unique...means item 1 has its own quantity and same goes to item 2...but in the same table... -- Message posted via http://www.accessmonster.com On Tue, 17 Apr 2007 05:28:12 GMT, "EMILYTAN via AccessMonster.com" <u33296@uwe> wrote: >How to perform sumation within that particular item but the item is not >unique...means item 1 has its own quantity and same goes to item 2...but in >the same table... Group By the item. For a more detailed answer, please post a more detailed question (with a des...

In excel change color of a range of cells based on a cell value
Based on a cell value from a drop down box, how can you make a range of cells to change background color? Use the cell the box is linked to in your conditional formatting formula. If your box is tied to, say, A1, make sure the conditional formula is like: =$A$1="value" value is whatever will be selected in the box. Then set the background color. Squeaky "kwitt" wrote: > Based on a cell value from a drop down box, how can you make a range of cells > to change background color? ...

Compare cells, update based on Ifs
I need to compare cells to the cell above them and to the right of them. Based on the comparisons I'll need to update the original cell with one of those adjoining cell values. After I finish with one column then I need to repeat the procedure on the column to the LEFT of the original column. I know IF, THEN and ELSE statesments but I don't know VB for Microsoft Office products. Range could be all 65,000+ rows on a workseet Start on ColumnJ, Row2 If ColumnJ, Row2 is Null _ If ColumnK, Row 2 is Not Null _ If ColumnJ, Row 1 is Not Null _ ColumnJ, Row2 Value is ...

Summing up user defined results
Hi all - I'm new to VBA programming in Excel and so any help i'd totally love! I'm currently writing a function. Objective: user can select rows (do not have to be sequential). User clicks on button. UserForm appears with summed results from ONLY rows that he selected. What I have now, well it doesn't work: Sub Button6_Click() Dim i As Integer Dim totalNumbers As Integer Dim aRange As range For Each a In Selection.Areas 'MsgBox "Area " & i & " of the selection contains " & _ ' a.Rows.Count & " rows." &...

Multiple variables to sort and sum, return values<0 with sum refer
Can anyone help me with this one please? I have this table of data. I'd like to be able to write a formula(s) which sums the No according to date and code, but then only returns a sum value (with the code and date in the two adjacent cells) if there is a value greater than 0. Code Ref No Date 1 G/032/05/999 400600 212 19/03/2010 2 G/032/03/001/999 400500 50 19/03/2010 3 G/032/02/001/001 400400 170 19/03/2010 4 G/032/05/999 400600 315 19/03/2010 5 G/032/03/001/999 400500 300 19/03/2010 6 G/032/05/999 400600 202 19/03/2010 7 G/032/03/001/002 40...

sum subform to form
=Sum([Forms]![frmCamPledgeList].[frmCamPledgeListSub].[Amount Pledged]) Form (frmCamPledgeList) with subform frmCamPledgeListSub). Subform has a field named Pledge Amount. I want to put a field on the form that gives me a total of the subform's Amount Pledged. I have tried the above, but I get an #error in the unbound text box. Do you need any more info? Any thoughts on why this does not work? Thanks in advance, Scott -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200912/1 The proper syntax is =Sum([Forms]![frmCa...

Calculate sum of a field within the query
I have a query that returns the details for a failure record during a specified time period. Where if I search between 1/1/08 and 1/31/08 the query returns the records of all failure records during that period. The row shows the part number and the total parts failed for that record. I need the query to then sum the total part failures for the previous 12 months. So I would see the following: Record # | part # | parts failed | Origination Date| Total Parts failed past 12 months 44444 | x | 4 | 1/2/08 | 200 44445 | Y |1 ...

Deleting multiple rows from value list
Is there a way to delete multiple rows in a value list for a Text column? I have over 200 rows out of a value list that are duplicates that I need to delete. I can delete them row by row but I'd like to click on the 1st row and shift click on the last row that needs to deleted. Is this possible? Thanks in advance (from a Project newbie) Yes. Select then click on the cut icon. Try it. -Jack Dahlgren "Val" <Val@discussions.microsoft.com> wrote in message news:6596A51E-9C60-46A4-B9AB-AAB335A92906@microsoft.com... > Is there a way to delete multiple ro...

chart data from same cell on multiple sheets
how can i chart data from the same cell on multiple sheets? when i enter sheet1:sheet5!a5 i get a invalid reference error. The values for a chartseries must all come from a single chart. You need to create a summary range on a worksheet to hold the values. This page has a few hints: http://peltiertech.com/Excel/ChartsHowTo/ChartFromDiffSheets.html - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ drhamann wrote: > how can i chart data from the same cell on multiple sheets? when i enter >...

Multiple criteria VLOOKUP
Hi, I have a seven column dataset (A1:G2000) and I want to lookup a value based on 3 criteria: one for each of the 1st three columns, so where the value in column A = X, column B = Y, column C = Z, with XYZ being three criteria defined by three other cells. Can anyone point me in the right direction. I'm wanting to figure out how to do it without creating a helper column where columns A,B and C are concatenated, and using the concatenating field as a lookup key. Any help greatly appreciated, Thanks....Jason Array formula =3DINDEX(D1:D10,MATCH("x"&"y"&...

=SUM Ranges Do Not Update
I have a Excel 2000 spread sheet, with the following macro to insert new row. Sub InsertRow() ' ' Macro1 Macro ' Macro recorded 4/27/2004 ' 'GoTo label, MyString ActiveSheet.Unprotect Application.Goto Reference:="MyCell" ActiveCell.Select ActiveCell.EntireRow.Insert ActiveCell.Offset(-1, 0).Select ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).Select ActiveCell.PasteSpecial xlPasteAll Application.CutCopyMode = False ActiveCell.Select ActiveSheet.Protect DrawingObjects:=True, Contents:=True Scenarios:=True End Sub The problem is that in the "Mycell&qu...

how to make this work if sum=5+n2 then sum becomes the value of s.
I want to get or create a formula in excel or access that allows me to keep a running total of my supplies ie... I have 2 pens, remove one and receive 2. answer in the cell becomes 3 pens then if I zero out the received cell the inventory cell still remembers that I have 3 pens not 4 pens (because I received 2 more pens) and visa versa when I zero out the received cell it remembers I have 3 pens not 1 pen(because I removed 1 pen) I believe the method you suggest is flawed. You have no audit trail. If the number on the sheet doesn't match your actual inventory, how will you figure out...

mail delivery for multiple email domains
Am running Exch 2003, on Win2003 server, AD etc. We have one AD forrest and one front end Exch 2003 server for OWA and one back end Exch 2003 server for Mailboxes. We have mail coming in for serveral email domains, all MX records pointing to the same Exhch server. @domain1.com, @domain2.com, etc. We have just added another email domain for our new phone system...@phonesys.domain1.com. This server is on an internal subnet and runs it's own proprietary smtp server. It will automatically route incoming emails to call groups (much like ACD phone systems). We have a recipient polic...

Conditional Formating #24
Hi, I have a list of data. It is 4 columns by 100 rows. Cells A2:D102 If the last column in the row is = "D" I want to highlight that row. So for example If Cell D2 = "D" then highlight Cells A2:D2 Is there any way to do this using conditional formating, I was trying but it would not highlight the other cells - I could highlight cell D2, but not cells A2:C2, based on the value of cell D2. In the conditional formatting box (Formatting->"Conditional Formatting"), Choose "Formula Is" from the dropdown box, and enter this formula (verbatim) in ...

Picking contacts from multiple users
Hi SBS 2003/Exchange 2003 with outlook 2003/2007 clients. Periodically I need to extract contacts our of multiple users' contacts and de-duplicate them into a final list. What is the mechanism I can use to achieve this? Thanks Regards You can import everything into an Excel or Access database and filter from there, or copy everything into a new Contacts folder in Outlook and use a duplicate remover tool. See http://howto-outlook.com/tag/duplicate-removers -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, H...

Sum value between dates problem driving me mad!
Good Evening All, I am really struggling here, have tried, nested IF's including AND's but am a bit stumped. I am fairly familiar with Arrays, but cannot seem to combine all. I have a data table (as detailed below). (Hopefully, this should be 'pastable' into Excel - it works for me) I simply wish to calculate the expected totals per month. Any help & assistance with this would be most welcome. Cheers, Mathew Note, earliest Start is 01/04/03 Start Finish Day Rate Apr-2003 May-2003 Jun-2003 Jul-2003 Aug-2003 01/04/2003 23.00 01/04/2003 09/07/2003 23.00 ...

Printing Multiple copies
Hello, How can I instruct the printer to cache my pages and print multiple copies of them, rather than send the same information over and over to print multiple copies? I am forgoing the MFC Printing Architecture due to some specific printing issues. and using the following: Logic in my OnPrint: for(i = 0; i < dlg.GetCopies(); i++) { DrawStuff(&dcPrinter); //DrawStuff() does some logic than calls OnDraw() } When I print ONE page of my graphics to the printer, my app sends out 5MBs of info. When I print TWO pages, it sends out 10MBs of info. (Double) I need to sen...

Conditional Sum Wizard
Currently I am setting up a sheet and I am using the conditional sum wizard for formulas. Once a formula is created the sytem won't let me copy or change a formula. If I try to copy (Copy, paste special) a formula to another cell, the formula won't work anymore. If I create a formula with the wizard and afterwards change one of the parameters, the formula does not work anymore. Can anyone give me a hint on how I can solve these issues? Thanks. Please don't multi-post - you have an answer elsewhere, relating to use of CSE. Pete On Jan 6, 9:23=A0am, MarcoKoenders <MarcoKo...

Sum Question
I am using Excel 2000 I have the following very simple formula in column j Sheet1 =SUM(B5*H5) I have this copied all the way down to line 40. It shows 0 in all of the cells all the way down. I would like for there to be a way that the cell would not show anything in it UNLESS there was something that it was calculating. For example. I have entered data in column b and column h through line 10, but it still shows 0 in column J all the way down to line 40. I realize that it is showing these 0's b/c I have placed the formula there, but is there a way that it will still calculate but only ...

Sum sum sum
Let me describe my problem... I have a form with with item number with is unique and then i put another form (subform) to linked to record the number of item in and out.... This means a item can have many in and out transactions which make the item number not unique.. My problem is I want to calculate the sum of in quantity within the same item. I want the sum to be keep on increasing when the user enter the quantity. Example user key in 2 then new user key 4 and i want the total quantity to be 6... Please help.... No idea of what i am talking? I will explain... -- Message posted via http:/...

How to download multiple templates ?
The template download site has gazillions of real estate templates for publisher but in order to see what each one looks like you have to download it individually. Is there a way to download them all at once so they can be browsed from within Publisher? The templates can be previewed before a download. Maybe your ActiveX console needs to be setup. What version Windows are you using? http://office.microsoft.com/templates/axinstall.aspx? -- Mary Sauer MS MVP http://office.microsoft.com/clipart/ http://www.mvps.org/msauer/getting_started.htm "Glenn ENgel" <anonymous@discussions....

Taking sum of a field from sub report
Hi On a sub report I have a field datetot which is the sum of two fields those two fields are in turn coming from two further sub reports of the sub report. How can I take the sum of datetot field to the main report? Thanks Regards See: Bring the total from a subreport onto a main report at: http://allenbrowne.com/casu-18.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "John" <John@nospam.infovis.co.uk> wrote in message news:OCWbU...

Conditional formatting date
Xl 2000 user. We have a vacation template with the day of the month listed as (1,2,3,etc) starting in A6. The months are column headings starting in row 4 and are date formats listed as 12/1/03,1/1/04, etc. I set up conditional formats to change the patterns for weekend days. Those are : =WEEKDAY(DATE(YEAR(AK$4),MONTH(AK$4),$A36))=1 =WEEKDAY(DATE(YEAR(AK$4),MONTH(AK$4),$A36))=7 I tried to set up a third condition that will gray the incorrect days (i.e. November 31st) =MONTH(DATE(YEAR(AK$4),MONTH(AK$4),$A36))>MONTH(AK$4) This works for November, but does not work for any month with ...

Multiple Installations of MS CRM on the same domain
Can I install multiple installations (Developemnt, QA and Production) of MS CRM on the same domain? ...

Multiple portfolios?
I am testing a trial version of Money 2004 before buying. I'd like to find out from someone if Money allows you to set up multiple portfolios with different investment accounts - all I've been able to do is all the accounts shown in one portfolio, which since there are different investment goals and time horizons is pretty meaningless. Also wonder if anyone knows if you can override the asset allocation tool and input your own allocation, specifically, different target allocations for each portfolio, and whether you can add additional asset classes. many thanks. Thanks for...