Sum Product

I am trying to get a $ sum based on 2 text conditions, but 
keep getting a #NUM! error. My formula works only when I 
limit my search to certain rows. Ideally, here's how I'd 
like it to work:

=SUMPRODUCT((O:O="Medical")*(R:R="Health Care")*(G:G))

The G column contains the $ figures that I'm trying to 
add. But every so often the column contains a necessary 
cell of text -- through trial and error, this fact seems 
to be causing the problem. 

Any ideas how I can fix this formula?
0
anonymous (74717)
6/21/2004 3:53:19 PM
excel.misc 78881 articles. 5 followers. Follow

5 Replies
400 Views

Similar Articles

[PageSpeed] 10

Hi

You cannot use full columns in a SUMPRODUCT. Try this:
=SUMPRODUCT((O2:O65000="Medical")*(R2:R65000="Health Care")*(G2:G65000))

-- 
Andy.


"Mike" <anonymous@discussions.microsoft.com> wrote in message
news:1f50701c457a7$df601ef0$a501280a@phx.gbl...
> I am trying to get a $ sum based on 2 text conditions, but
> keep getting a #NUM! error. My formula works only when I
> limit my search to certain rows. Ideally, here's how I'd
> like it to work:
>
> =SUMPRODUCT((O:O="Medical")*(R:R="Health Care")*(G:G))
>
> The G column contains the $ figures that I'm trying to
> add. But every so often the column contains a necessary
> cell of text -- through trial and error, this fact seems
> to be causing the problem.
>
> Any ideas how I can fix this formula?


0
andyb1 (494)
6/21/2004 4:21:22 PM
Andy -- thanks for reply. I tried, but result is now 
#VALUE!

My formula works when my cell range for columns O, R, and 
G is limited to rows 2:23. (G2:G23 contains all $ 
figures.) BUT when I extend the range even one row beyond 
(whether to row 24 or 65000 as in your example), the 
formula doesn't work. (The significance of row 24 is that 
G24 contains text, not a $ figure.) Maybe SUMPRODUCT just 
won't work if column G has a mix of $ figures and text? 

>-----Original Message-----
>Hi
>
>You cannot use full columns in a SUMPRODUCT. Try this:
>=SUMPRODUCT((O2:O65000="Medical")*(R2:R65000="Health 
Care")*(G2:G65000))
>
>-- 
>Andy.
>
>
>"Mike" <anonymous@discussions.microsoft.com> wrote in 
message
>news:1f50701c457a7$df601ef0$a501280a@phx.gbl...
>> I am trying to get a $ sum based on 2 text conditions, 
but
>> keep getting a #NUM! error. My formula works only when I
>> limit my search to certain rows. Ideally, here's how I'd
>> like it to work:
>>
>> =SUMPRODUCT((O:O="Medical")*(R:R="Health Care")*(G:G))
>>
>> The G column contains the $ figures that I'm trying to
>> add. But every so often the column contains a necessary
>> cell of text -- through trial and error, this fact seems
>> to be causing the problem.
>>
>> Any ideas how I can fix this formula?
>
>
>.
>
0
anonymous (74717)
6/21/2004 4:55:55 PM
This version of =sumproduct() seems to be more forgiving:

=SUMPRODUCT(--(O2:O65000="Medical"),--(R2:R65000="Health Care"),(g2:g65000))

As long as you don't have any errors in the cells.

And you may want to try to keep that 65000 as small as possible.  If you're only
using a few hundred rows, stop at 1000.  (Big enough, but not too big.  Watch
the difference in recalculation speed with giant numbers.)

You also may want to take a look at Data|pivottable.  You can get some very nice
summaries with not much work.

Mike wrote:
> 
> Andy -- thanks for reply. I tried, but result is now
> #VALUE!
> 
> My formula works when my cell range for columns O, R, and
> G is limited to rows 2:23. (G2:G23 contains all $
> figures.) BUT when I extend the range even one row beyond
> (whether to row 24 or 65000 as in your example), the
> formula doesn't work. (The significance of row 24 is that
> G24 contains text, not a $ figure.) Maybe SUMPRODUCT just
> won't work if column G has a mix of $ figures and text?
> 
> >-----Original Message-----
> >Hi
> >
> >You cannot use full columns in a SUMPRODUCT. Try this:
> >=SUMPRODUCT((O2:O65000="Medical")*(R2:R65000="Health
> Care")*(G2:G65000))
> >
> >--
> >Andy.
> >
> >
> >"Mike" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:1f50701c457a7$df601ef0$a501280a@phx.gbl...
> >> I am trying to get a $ sum based on 2 text conditions,
> but
> >> keep getting a #NUM! error. My formula works only when I
> >> limit my search to certain rows. Ideally, here's how I'd
> >> like it to work:
> >>
> >> =SUMPRODUCT((O:O="Medical")*(R:R="Health Care")*(G:G))
> >>
> >> The G column contains the $ figures that I'm trying to
> >> add. But every so often the column contains a necessary
> >> cell of text -- through trial and error, this fact seems
> >> to be causing the problem.
> >>
> >> Any ideas how I can fix this formula?
> >
> >
> >.
> >

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
6/22/2004 12:48:15 AM
Thank you Dave and Andy. Yesterday I kept poking around 
the internet and found a solution (which maybe 
accomplishes the same as your formula, Dave?). I replaced 
my last * with a comma, which somehow tells Excel to 
ignore the text in column G and just add up the numbers. 
And I didn't need 2 parentheses at the very end, which 
confused me at first but makes sense when I study the 
formula closely. 

So my final formula looks like this (I used row 400 
instead of 65000, but I think either would work OK):

=SUMPRODUCT((O2:O400="Medical")*(R2:R400="Health 
Care"),G2:G400)

It's that little commma that did the trick. The end result 
is the dollar figure sum I was looking for.

>-----Original Message-----
>This version of =sumproduct() seems to be more forgiving:
>
>=SUMPRODUCT(--(O2:O65000="Medical"),--(R2:R65000="Health 
Care"),(g2:g65000))
>
>As long as you don't have any errors in the cells.
>
>And you may want to try to keep that 65000 as small as 
possible.  If you're only
>using a few hundred rows, stop at 1000.  (Big enough, but 
not too big.  Watch
>the difference in recalculation speed with giant numbers.)
>
>You also may want to take a look at Data|pivottable.  You 
can get some very nice
>summaries with not much work.
>
>Mike wrote:
>> 
>> Andy -- thanks for reply. I tried, but result is now
>> #VALUE!
>> 
>> My formula works when my cell range for columns O, R, 
and
>> G is limited to rows 2:23. (G2:G23 contains all $
>> figures.) BUT when I extend the range even one row 
beyond
>> (whether to row 24 or 65000 as in your example), the
>> formula doesn't work. (The significance of row 24 is 
that
>> G24 contains text, not a $ figure.) Maybe SUMPRODUCT 
just
>> won't work if column G has a mix of $ figures and text?
>> 
>> >-----Original Message-----
>> >Hi
>> >
>> >You cannot use full columns in a SUMPRODUCT. Try this:
>> >=SUMPRODUCT((O2:O65000="Medical")*(R2:R65000="Health
>> Care")*(G2:G65000))
>> >
>> >--
>> >Andy.
>> >
>> >
>> >"Mike" <anonymous@discussions.microsoft.com> wrote in
>> message
>> >news:1f50701c457a7$df601ef0$a501280a@phx.gbl...
>> >> I am trying to get a $ sum based on 2 text 
conditions,
>> but
>> >> keep getting a #NUM! error. My formula works only 
when I
>> >> limit my search to certain rows. Ideally, here's how 
I'd
>> >> like it to work:
>> >>
>> >> =SUMPRODUCT((O:O="Medical")*(R:R="Health Care")*
(G:G))
>> >>
>> >> The G column contains the $ figures that I'm trying 
to
>> >> add. But every so often the column contains a 
necessary
>> >> cell of text -- through trial and error, this fact 
seems
>> >> to be causing the problem.
>> >>
>> >> Any ideas how I can fix this formula?
>> >
>> >
>> >.
>> >
>
>-- 
>
>Dave Peterson
>ec35720@msn.com
>.
>
0
anonymous (74717)
6/22/2004 1:44:33 PM
Glad you got it working.

I used parentheses around all the arguments in the sumproduct function just
because I think it makes it easier to read.  (personal preference only)  

Mike wrote:
> 
> Thank you Dave and Andy. Yesterday I kept poking around
> the internet and found a solution (which maybe
> accomplishes the same as your formula, Dave?). I replaced
> my last * with a comma, which somehow tells Excel to
> ignore the text in column G and just add up the numbers.
> And I didn't need 2 parentheses at the very end, which
> confused me at first but makes sense when I study the
> formula closely.
> 
> So my final formula looks like this (I used row 400
> instead of 65000, but I think either would work OK):
> 
> =SUMPRODUCT((O2:O400="Medical")*(R2:R400="Health
> Care"),G2:G400)
> 
> It's that little commma that did the trick. The end result
> is the dollar figure sum I was looking for.
> 
> >-----Original Message-----
> >This version of =sumproduct() seems to be more forgiving:
> >
> >=SUMPRODUCT(--(O2:O65000="Medical"),--(R2:R65000="Health
> Care"),(g2:g65000))
> >
> >As long as you don't have any errors in the cells.
> >
> >And you may want to try to keep that 65000 as small as
> possible.  If you're only
> >using a few hundred rows, stop at 1000.  (Big enough, but
> not too big.  Watch
> >the difference in recalculation speed with giant numbers.)
> >
> >You also may want to take a look at Data|pivottable.  You
> can get some very nice
> >summaries with not much work.
> >
> >Mike wrote:
> >>
> >> Andy -- thanks for reply. I tried, but result is now
> >> #VALUE!
> >>
> >> My formula works when my cell range for columns O, R,
> and
> >> G is limited to rows 2:23. (G2:G23 contains all $
> >> figures.) BUT when I extend the range even one row
> beyond
> >> (whether to row 24 or 65000 as in your example), the
> >> formula doesn't work. (The significance of row 24 is
> that
> >> G24 contains text, not a $ figure.) Maybe SUMPRODUCT
> just
> >> won't work if column G has a mix of $ figures and text?
> >>
> >> >-----Original Message-----
> >> >Hi
> >> >
> >> >You cannot use full columns in a SUMPRODUCT. Try this:
> >> >=SUMPRODUCT((O2:O65000="Medical")*(R2:R65000="Health
> >> Care")*(G2:G65000))
> >> >
> >> >--
> >> >Andy.
> >> >
> >> >
> >> >"Mike" <anonymous@discussions.microsoft.com> wrote in
> >> message
> >> >news:1f50701c457a7$df601ef0$a501280a@phx.gbl...
> >> >> I am trying to get a $ sum based on 2 text
> conditions,
> >> but
> >> >> keep getting a #NUM! error. My formula works only
> when I
> >> >> limit my search to certain rows. Ideally, here's how
> I'd
> >> >> like it to work:
> >> >>
> >> >> =SUMPRODUCT((O:O="Medical")*(R:R="Health Care")*
> (G:G))
> >> >>
> >> >> The G column contains the $ figures that I'm trying
> to
> >> >> add. But every so often the column contains a
> necessary
> >> >> cell of text -- through trial and error, this fact
> seems
> >> >> to be causing the problem.
> >> >>
> >> >> Any ideas how I can fix this formula?
> >> >
> >> >
> >> >.
> >> >
> >
> >--
> >
> >Dave Peterson
> >ec35720@msn.com
> >.
> >

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
6/22/2004 11:45:50 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...

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...

Printing inventory products
Can anyone shed some light on this problem? When I view my "inventory products" they are listed in alphabetical order....but when I print them, they print in the order they were entered. Thanks, Bob ...

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 ...

=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...

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 ...

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:/...

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...

sum command do not display the result eg:=sum(c5:c8)-total not
sum command do not display the result eg:=sum(c5:c8)-total not display the result in the cell even when sigma is clicked the same What is displayed instead? If you see the formula, then format the cell as General (or anything but text) and reenter that formula. If you see the wrong answer, then maybe you have calculation set to manual. Tools|Option|calculation tab is how you'd change it in xl2003 menus. If that's not it, then maybe your values in those cells (C5:C8) aren't really numbers. Reformat that range as General (not text) and reenter the values. abbbalu wr...

Adding Sum
I made a query report with unique records to display,I don't want repeating item displayed in the report. What should I do to sum the other qty delivered in a single item. Item Qty Date Pork 50 08/01/05 60 08/10/05 20 08/15/05 should be Item Qty Date Pork 130 08/01/05 - 08/15/05 thanks & Godspeed. One way Sub Test() Dim iLastRow As Long Dim i As Long Dim dteMax As Date Dim dteMin As Date Dim...

Link Lead with Products
Hi everybody, How to link lead or customer with products (Products that are in interest for the customer)? Another question about CRM 4.0 Licensing, is it per concurrent users? Thanks in advance. AMH. Just create another relationship as a N-N between Lead and Accounts - will probbably do your job. As for licencing - User Licences are NOT concurrent as each has to been an active AD user and then enabled in CRM. Pete "AMH" <AMH@discussions.microsoft.com> wrote in message news:FD3F70AF-6B49-4307-88E4-1911A759819D@microsoft.com... > Hi everybody, > > How to l...

SUM with WHERE
I have one sheet with a bunch of records that look like: Name, Lang, Qty Peter, English, 5 Peter, French, 2 Dave, English, 7 .... On a second sheet I want to create a summary of the records: English, 12 French, 2 So What I am kind of looking for is this: English, =sum of $DRECORDS where Lang=English French, =sum of $DRECORDS where Lang=French Any ideas how to do this in excel? Peter Look in the help index for SUMIF -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Peter Carlson" <peter@h_o_w_u_d_o_d_a_t.com> wrote in message news:e1l3%233eXI...

Sum duplicate lines in a table
I have a table which contains a list of products soted by poduct name. Against each product there is a stock quantity, each Item may appear more than once. I want to be create a query which will give me a list of the products, but with only one entry per item, with a total quantity for each item. Is this possible? Thanks Neil wrote: >I have a table which contains a list of products soted by poduct name. >Against each product there is a stock quantity, each Item may appear more >than once. > I want to be create a query which will give me a list of the products,...

Opportunity product #3
I wanted to create email template for opportunity module, which will pull opportunity product info, account and contact info and opportunity related fields. But I couldn=92t see the opporutnity product fields in insert/update option in email template. Is there a way to include opportunity product info in the template. Any help is appreciated. I don't think it's possible, because it's a 1:many relationship. Maybe it's exactly that what you want (inserting a list of products into the body), but I think you are limited to many:1 relationships (aka lookup fields). -- Michael ...

Sum on horizontal lookup.
in one row (a10:aa10), i have a name in one cell, then value in the next, name in one cell, then value in the next... Some of the names in the row are repeated. Based on a lookup value (which will be one of the names), I want to: search the row for the lookup value add the value to the right each time the lookup value is found. example: a10 a11 a12 a13 a14 a15 a16 a17 errors 10 correct 10 errors 10 correct 20 lookup value "errors", result 20 lookup value "correct", result 30 =SUMIF(A10:Z10,"errors",B10:AA10) -- _____________...

Running Sum 01-27-10
Hello, I have been looking at some running sum examples (http:// support.microsoft.com/kb/290136), but can not work out how to apply it to my query. I have Recieved, Recieved Amount .. then Cleared, Cleared Amount .. i am trying to work out a running backlog of work. So A: Recieved, Rec Amount .. Cleared, Clrd Amount .. Backlog, Backlog Amount. B: Recieved, Rec Amount .. Cleared, Clrd Amount .. Backlog of A - Cleared + Received. C: Recieved, Rec Amount .. Cleared, Clrd Amount .. Backlog of B - Cleared + Received. and so on? Im guessing its a DSUM thing, but i cant make th...

Exchange DRP Product
Hi, Looking between NSI Double Take and Xosoft WanSynch HA, but having trouble choosing one for an Exchange DRP implementation... If you have any opinion or experience ( even better ) with one of these products, I would appreciate if you let me know via this newsgroup.... Thanks !!! -- -- --- On Thu, 30 Mar 2006 06:43:02 -0500, "Thinkpad21" <thinkpad21@yahoo.com> wrote: >Hi, > >Looking between NSI Double Take and Xosoft WanSynch HA, but having trouble >choosing one for an Exchange DRP implementation... > >If you have any opinion or experience ( ev...

Help on SUM cells with formulas
At F199 I have the formula =SUM(F177:F198) but rows 177 to 198 contain formulas like =(+E180-E179) and F199 formula won't work. Do I need to extract correctly the values only? is it possible? Thanks much. Benjamin What exactly does "formula won't work" mean? What kind of return are you getting? No answer? - Wrong answer? - Error message? -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! -------------------------------------------------------------------...

How to Sum a column if reference column is blank
How do I sum a cloumn of numbers when my reference column is blank? >when my reference column is blank? What does that mean? -- Mike When competing hypotheses are equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. Occam''''s razor (Abbrev) "Rusty" wrote: > How do I sum a cloumn of numbers when my reference column is blank? See if this is what you had in mind... 96...x 51..... 22...p 73..... 81..... Sum A1:A5 where the corresponding cell in B1:B5 is blank/empty: ...

Sum, Sum if or if???????
Two things: I inherited a spreadsheet and everytime I save or update a cell I get message that reads "The macros in this project have been disabled Please refer to online help etc to enable". How can I get rid of this message, as as far as I know I not set up an macros and there are none in the list after checking the macro list (the spreadsheet I have enclosed for question 2 example does this i you enter or change an amount)! 2. Can you help with a formula, basically I want excel to provide dat if any particular figure is over a certain amount. see attache example. Thanks in ad...