Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Can I SUM column C IF Column A=X AND Column D=Y?

If you could follow that...
I have a number of columns of information for any given row. I would like to
set up a sheet that will sum Column C for all rows IF Column A = {a given
value} AND Column D = {a different given value}. I may even need to throw in
that Column B = {another given value}. Can I do this and how?

I've run across something about VLOOKUP, but I'm not sure how to make that
work. I'm primarily a CAD operator making brief forays into Excel, and I keep
thinking it has got to be easier than all the manual sorting I'm currently
doing.

I'm using Excel 2003 (on Windows XP SP2)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Can I SUM column C IF Column A=X AND Column D=Y?

Assign your "given values" to particular cells, so they can easily be
changed, without having to revise the formula itself (E1, E2).


=Sumproduct((A1:A100=E1)*(D1:D100=E2)*C1:C100)

To add other criteria, simply add another argument:

=Sumproduct((A1:A100=E1)*(D1:D100=E2)*(B1:B100=E3) *C1:C100)

All ranges should be the same size, and you *cannot* use entire columns
(A:A - B:B)

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Minx" wrote in message
...
If you could follow that...
I have a number of columns of information for any given row. I would like to
set up a sheet that will sum Column C for all rows IF Column A = {a given
value} AND Column D = {a different given value}. I may even need to throw in
that Column B = {another given value}. Can I do this and how?

I've run across something about VLOOKUP, but I'm not sure how to make that
work. I'm primarily a CAD operator making brief forays into Excel, and I
keep
thinking it has got to be easier than all the manual sorting I'm currently
doing.

I'm using Excel 2003 (on Windows XP SP2)


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Can I SUM column C IF Column A=X AND Column D=Y?

=SUMPRODUCT((Xewks!A1:A425=A10)*(Xewks!E1:E425=5)* (Xewks!D1:D425="B
Borrow")*Xewks!B1:B425)

Here is what I put in for my SUMPRODUCT formula, but it just gives me a
#VALUE error. Closer than what I was doing before, but still not working - so
I must be misunderstanding something.

Thank you for your help!

"RagDyeR" wrote:

Assign your "given values" to particular cells, so they can easily be
changed, without having to revise the formula itself (E1, E2).


=Sumproduct((A1:A100=E1)*(D1:D100=E2)*C1:C100)

To add other criteria, simply add another argument:

=Sumproduct((A1:A100=E1)*(D1:D100=E2)*(B1:B100=E3) *C1:C100)

All ranges should be the same size, and you *cannot* use entire columns
(A:A - B:B)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Can I SUM column C IF Column A=X AND Column D=Y?

You probably have values in B1 to B425 that are *not* true XL recognized
numbers!

Could B1 be a text header?
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"Minx" wrote in message
...
=SUMPRODUCT((Xewks!A1:A425=A10)*(Xewks!E1:E425=5)* (Xewks!D1:D425="B
Borrow")*Xewks!B1:B425)

Here is what I put in for my SUMPRODUCT formula, but it just gives me a
#VALUE error. Closer than what I was doing before, but still not working -
so
I must be misunderstanding something.

Thank you for your help!

"RagDyeR" wrote:

Assign your "given values" to particular cells, so they can easily be
changed, without having to revise the formula itself (E1, E2).


=Sumproduct((A1:A100=E1)*(D1:D100=E2)*C1:C100)

To add other criteria, simply add another argument:

=Sumproduct((A1:A100=E1)*(D1:D100=E2)*(B1:B100=E3) *C1:C100)

All ranges should be the same size, and you *cannot* use entire columns
(A:A - B:B)



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Can I SUM column C IF Column A=X AND Column D=Y?

That was it!
(Actually, everything in Row 1 is a text header)
Thank you so much!!


"RagDyeR" wrote:

You probably have values in B1 to B425 that are *not* true XL recognized
numbers!

Could B1 be a text header?




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Can I SUM column C IF Column A=X AND Column D=Y?

You're welcome, and thank you for the feed-back.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Minx" wrote in message
...
That was it!
(Actually, everything in Row 1 is a text header)
Thank you so much!!


"RagDyeR" wrote:

You probably have values in B1 to B425 that are *not* true XL recognized
numbers!

Could B1 be a text header?



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Can I SUM column C IF Column A=X AND Column D=Y?

Sorry, I meant cond2 and cond3 are never both true for the same sumcolumnvalue.

Jeff

"travcoe21" wrote:
Note that in order for this to work the way it's supposed to, cond1 and
cond3 must never both be true for the same sumcolumnvalue. Which for my
application is always the case.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Can I SUM column C IF Column A=X AND Column D=Y?

Is that a good description?

Yes

{SUM(AND(cond1, cond2)*sumcolumnvalue)}


AND returns a single result where you need an array of results.

It sounds like you want an OR comparison: sum C if A = x *or* D = y.

Try one of these:

=SUMPRODUCT(--((A1:A10="x")+(D1:D10="y")0),C1:C10)

=SUMPRODUCT(SIGN((A1:A10="x")+(D1:D10="y")),C1:C10 )

--
Biff
Microsoft Excel MVP


"travcoe21" wrote in message
...
Sorry, I meant cond2 and cond3 are never both true for the same
sumcolumnvalue.

Jeff

"travcoe21" wrote:
Note that in order for this to work the way it's supposed to, cond1 and
cond3 must never both be true for the same sumcolumnvalue. Which for my
application is always the case.



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Can I SUM column C IF Column A=X AND Column D=Y?

I am trying to sum a column of both negative and positive numbers on another
worksheet based on two conditions. I have tried to construct an array that
would =Sum(if((A2:A278,="2000")*(M2:M278,="0"),M2:M278) )

Should that not sum the column M2:M278 positive integers based on the
criteria that all rows in A2:A278 are equal to "2000".???



"Minx" wrote:

If you could follow that...
I have a number of columns of information for any given row. I would like to
set up a sheet that will sum Column C for all rows IF Column A = {a given
value} AND Column D = {a different given value}. I may even need to throw in
that Column B = {another given value}. Can I do this and how?

I've run across something about VLOOKUP, but I'm not sure how to make that
work. I'm primarily a CAD operator making brief forays into Excel, and I keep
thinking it has got to be easier than all the manual sorting I'm currently
doing.

I'm using Excel 2003 (on Windows XP SP2)

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Can I SUM column C IF Column A=X AND Column D=Y?

To exclude negative values from the sum...

Works in any "modern" version of Excel:

=SUMPRODUCT(--(A2:A278=2000),--(M2:M2780),M2:M278)

If you're using Excel 2007:

=SUMIFS(M2:M278,A2:A278,2000,M2:M278,"0")

--
Biff
Microsoft Excel MVP


"Terry" wrote in message
...
I am trying to sum a column of both negative and positive numbers on
another
worksheet based on two conditions. I have tried to construct an array that
would =Sum(if((A2:A278,="2000")*(M2:M278,="0"),M2:M278) )

Should that not sum the column M2:M278 positive integers based on the
criteria that all rows in A2:A278 are equal to "2000".???



"Minx" wrote:

If you could follow that...
I have a number of columns of information for any given row. I would like
to
set up a sheet that will sum Column C for all rows IF Column A = {a given
value} AND Column D = {a different given value}. I may even need to throw
in
that Column B = {another given value}. Can I do this and how?

I've run across something about VLOOKUP, but I'm not sure how to make
that
work. I'm primarily a CAD operator making brief forays into Excel, and I
keep
thinking it has got to be easier than all the manual sorting I'm
currently
doing.

I'm using Excel 2003 (on Windows XP SP2)





  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Can I SUM column C IF Column A=X AND Column D=Y?

=SUM(IF((A2:A278=2000)*(M2:M278=0),M2:M278))

This is an array formula CTRL + SHIFT + ENTER


Gord Dibben MS Excel MVP

On Sun, 25 Apr 2010 10:37:01 -0700, Terry
wrote:

I am trying to sum a column of both negative and positive numbers on another
worksheet based on two conditions. I have tried to construct an array that
would =Sum(if((A2:A278,="2000")*(M2:M278,="0"),M2:M278) )

Should that not sum the column M2:M278 positive integers based on the
criteria that all rows in A2:A278 are equal to "2000".???



"Minx" wrote:

If you could follow that...
I have a number of columns of information for any given row. I would like to
set up a sheet that will sum Column C for all rows IF Column A = {a given
value} AND Column D = {a different given value}. I may even need to throw in
that Column B = {another given value}. Can I do this and how?

I've run across something about VLOOKUP, but I'm not sure how to make that
work. I'm primarily a CAD operator making brief forays into Excel, and I keep
thinking it has got to be easier than all the manual sorting I'm currently
doing.

I'm using Excel 2003 (on Windows XP SP2)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I combine spreadsheets and documents in one file? Trish Excel Discussion (Misc queries) 3 November 9th 06 09:17 PM
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Column picked randomly with probability relative to number of entr Neil Goldwasser Excel Worksheet Functions 4 May 30th 06 08:55 AM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"