#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default SumIF Formula

I need to sum a column based on two different variables. For example I need
to sum Column A if Column B = 123 and Column C = XD. For the example below
the sumif formula would equal "11." I have tried creating this formula
several times but I have yet to succeed as I have always gotten some type of
error. I could use the dsum formula but I would like to stick to"if"
formulas. Any suggestions?

Col. A Col. B Col.C
1 123 XD
5 222 XD
10 123 CC
10 123 XD
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default SumIF Formula

SUMPRODUCT is the way to go here.

=SUMPRODUCT(--($B$2:$B$100=123),--($C$2:$C$100="XD"),($A$2:$A$100))

Note, I am assuming all values in column A and column B are numbers, not text.
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"Rody2003" wrote:

I need to sum a column based on two different variables. For example I need
to sum Column A if Column B = 123 and Column C = XD. For the example below
the sumif formula would equal "11." I have tried creating this formula
several times but I have yet to succeed as I have always gotten some type of
error. I could use the dsum formula but I would like to stick to"if"
formulas. Any suggestions?

Col. A Col. B Col.C
1 123 XD
5 222 XD
10 123 CC
10 123 XD

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default SumIF Formula

Something like this should work fine:
=SUMPRODUCT((B1:B4=123)*(C1:C4="XD"),A1:A4)
Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"Rody2003" wrote:
I need to sum a column based on two different variables. For example I need
to sum Column A if Column B = 123 and Column C = XD. For the example below
the sumif formula would equal "11." I have tried creating this formula
several times but I have yet to succeed as I have always gotten some type of
error. I could use the dsum formula but I would like to stick to"if"
formulas. Any suggestions?

Col. A Col. B Col.C
1 123 XD
5 222 XD
10 123 CC
10 123 XD

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default SumIF Formula

Thanks alot the formula is working perfectly!

"Max" wrote:

Something like this should work fine:
=SUMPRODUCT((B1:B4=123)*(C1:C4="XD"),A1:A4)
Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"Rody2003" wrote:
I need to sum a column based on two different variables. For example I need
to sum Column A if Column B = 123 and Column C = XD. For the example below
the sumif formula would equal "11." I have tried creating this formula
several times but I have yet to succeed as I have always gotten some type of
error. I could use the dsum formula but I would like to stick to"if"
formulas. Any suggestions?

Col. A Col. B Col.C
1 123 XD
5 222 XD
10 123 CC
10 123 XD

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default SumIF Formula

How do I mark this as answered?

"John C" wrote:

SUMPRODUCT is the way to go here.

=SUMPRODUCT(--($B$2:$B$100=123),--($C$2:$C$100="XD"),($A$2:$A$100))

Note, I am assuming all values in column A and column B are numbers, not text.
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"Rody2003" wrote:

I need to sum a column based on two different variables. For example I need
to sum Column A if Column B = 123 and Column C = XD. For the example below
the sumif formula would equal "11." I have tried creating this formula
several times but I have yet to succeed as I have always gotten some type of
error. I could use the dsum formula but I would like to stick to"if"
formulas. Any suggestions?

Col. A Col. B Col.C
1 123 XD
5 222 XD
10 123 CC
10 123 XD



  #6   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default SumIF Formula

How do I mark this as answered?

From where you're posting / reading responses, ie in MS' webpages
just click the "Yes" button (like the one below) in John's response

Do note that in John's response, the parens around: $A$2:$A$100
is not necessary, ie it could be just:

=SUMPRODUCT(--($B$2:$B$100=123),--($C$2:$C$100="XD"),$A$2:$A$100)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:362 Subscribers:64
xdemechanik
---


  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default SumIF Formula

You're welcome. Good to hear that.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:362 Subscribers:64
xdemechanik
---
"Rody2003" wrote in message
...
Thanks a lot the formula is working perfectly!



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
SUMIF formula Jan T.[_2_] Excel Worksheet Functions 7 October 18th 07 01:42 PM
Nesting a sumproduct formula within a sumif formula. jerrymcm Excel Discussion (Misc queries) 2 October 3rd 07 03:35 PM
multiply formula where 1 cell has a (sumif) formula as a result kcip Excel Worksheet Functions 1 May 3rd 07 07:41 AM
Formula for If - SUMIF Keith L Excel Discussion (Misc queries) 2 November 11th 06 11:22 PM
Is there a MAXIF formula similar to the SUMIF formula? tlc Excel Discussion (Misc queries) 2 March 13th 06 08:07 PM


All times are GMT +1. The time now is 07:47 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"