Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
rita
 
Posts: n/a
Default total of certain cells using 2 criterias

I want to do a sumif but using 2 criterias which appear in 2 separate columns
within the worksheet.

a yes 15000
a no 16000
a yes 20000
a no 30000
b yes 40000
b yes 50000

In the table above, I need to know the sum of column c if I choose a
criteria found in column a and column b together.
Can you help?
Thanks
Rita


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(A1:A100="a"),--(B1:B100="yes"),C1:C100)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"rita" wrote in message
...
I want to do a sumif but using 2 criterias which appear in 2 separate

columns
within the worksheet.

a yes 15000
a no 16000
a yes 20000
a no 30000
b yes 40000
b yes 50000

In the table above, I need to know the sum of column c if I choose a
criteria found in column a and column b together.
Can you help?
Thanks
Rita




  #3   Report Post  
Nick Hodge
 
Posts: n/a
Default

Rita

If the data is in A1:C6, for example, the following will sum the data in C
where A="b" and B="yes"

=SUMPRODUCT(--(A1:A6="b"),--(B1:B6="yes"),(C1:C6))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"rita" wrote in message
...
I want to do a sumif but using 2 criterias which appear in 2 separate
columns
within the worksheet.

a yes 15000
a no 16000
a yes 20000
a no 30000
b yes 40000
b yes 50000

In the table above, I need to know the sum of column c if I choose a
criteria found in column a and column b together.
Can you help?
Thanks
Rita




  #4   Report Post  
rita
 
Posts: n/a
Default

Thank you boys and it worked a treat, but can you explain why you inserted
"--" in the formula? What is its function in the array?
Thanks


"Nick Hodge" wrote:

Rita

If the data is in A1:C6, for example, the following will sum the data in C
where A="b" and B="yes"

=SUMPRODUCT(--(A1:A6="b"),--(B1:B6="yes"),(C1:C6))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"rita" wrote in message
...
I want to do a sumif but using 2 criterias which appear in 2 separate
columns
within the worksheet.

a yes 15000
a no 16000
a yes 20000
a no 30000
b yes 40000
b yes 50000

In the table above, I need to know the sum of column c if I choose a
criteria found in column a and column b together.
Can you help?
Thanks
Rita





  #5   Report Post  
Max
 
Posts: n/a
Default

"rita" wrote
.. can you explain why you inserted
"--" in the formula? What is its function in the array?


Try the 2* responses in this previous post:

http://tinyurl.com/64py9

*Bob Phillips' link to his page, and
Jason's example and explanation, with a nice touch on its evolution

See also JE McGimpsey's:
http://www.mcgimpsey.com/excel/formulae/doubleneg.html

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----




  #6   Report Post  
Ken Wright
 
Posts: n/a
Default

http://www.mcgimpsey.com/excel/formulae/doubleneg.html

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"rita" wrote in message
...
Thank you boys and it worked a treat, but can you explain why you inserted
"--" in the formula? What is its function in the array?
Thanks


"Nick Hodge" wrote:

Rita

If the data is in A1:C6, for example, the following will sum the data in

C
where A="b" and B="yes"

=SUMPRODUCT(--(A1:A6="b"),--(B1:B6="yes"),(C1:C6))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"rita" wrote in message
...
I want to do a sumif but using 2 criterias which appear in 2 separate
columns
within the worksheet.

a yes 15000
a no 16000
a yes 20000
a no 30000
b yes 40000
b yes 50000

In the table above, I need to know the sum of column c if I choose a
criteria found in column a and column b together.
Can you help?
Thanks
Rita







  #7   Report Post  
Dana DeLouis
 
Posts: n/a
Default

You've got the best answers, but if you ever get stuck in the future with
something similar, here is another option...
Go to Tools | Add-Ins, and select "Conditional Sum Wizard." Click ok.
Then go to Tools | Conditional Sum..
This will walk you thru setting up your equation.
Excel's Conditional Sum wizard prefers to use SUM & IF as an array formula.
(Entered with Ctrl+Shift+Enter). The wizard will do this for you.

=SUM(IF(Col_A="a",IF(Col_B="yes",Col_C,0),0))

You can remove the ending 0's if you wish.
=SUM(IF(Col_A="a",IF(Col_B="yes",Col_C)))

It's best to have column headings, but if not, you can go back and edit your
equation and re-enter the formula (with Ctrl+Shift+Enter).
Again, just another option if you get stuck.

--
Dana DeLouis
Win XP & Office 2003


"rita" wrote in message
...
Thank you boys and it worked a treat, but can you explain why you inserted
"--" in the formula? What is its function in the array?
Thanks


"Nick Hodge" wrote:

Rita

If the data is in A1:C6, for example, the following will sum the data in
C
where A="b" and B="yes"

=SUMPRODUCT(--(A1:A6="b"),--(B1:B6="yes"),(C1:C6))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"rita" wrote in message
...
I want to do a sumif but using 2 criterias which appear in 2 separate
columns
within the worksheet.

a yes 15000
a no 16000
a yes 20000
a no 30000
b yes 40000
b yes 50000

In the table above, I need to know the sum of column c if I choose a
criteria found in column a and column b together.
Can you help?
Thanks
Rita







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
I want to only at cells that are in bold to a total in Excel Conrad Excel Discussion (Misc queries) 2 February 16th 05 02:10 PM
highlight cells to obtain total without using formula? rdavia Excel Discussion (Misc queries) 2 January 18th 05 05:29 PM
calculate which cells in column A will give me the total of column Ken Excel Worksheet Functions 4 January 6th 05 06:25 AM
ADDING SUM TOTAL OF MORE THAN 30 CELLS IN A COLUMN TOGETHER - WON. Robin Smith Excel Discussion (Misc queries) 0 December 20th 04 08:47 PM
In SUM cells the # sign keeps showing instead of total fyremunki Excel Discussion (Misc queries) 3 December 3rd 04 08:13 PM


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