Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help writing SumIF with Multiple Criteria 1

Status
Not open for further replies.

TAngel

Technical User
Apr 16, 2001
73
US
I need a help writing a formula that sums column C1:C3000 if Column A = Dental Care and in the same row Column B = Spouse. How do I do that?
Thanks,
Teresa
 
In 2010 I think there is a new formula for this but outsode of that, you can use SMPRODUCT()

=SUMPRODUCT((UPPER($A$1:$A$3000)="DENTAL CARE")*(UPPER($B$1:$B$3000)="SPOUSE")*($C$1:$C$3000))

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff, I haven't used SumProduct before. This totally worked for me. Thank you
Teresa
 
The new function, which became available in Excel 2007, is SUMIFS. It is like SumIf, but with multiple Conditions available.

It actually has a couple of advantages over SumProduct:
[ul][li]It can accept whole column references (No more A2:A65536)[/li]
[li]It doesn't break on mixed data types, like including a text header in a column of numbers[/li][/ul]

In your case, it would look like this:
[tab][COLOR=blue white]=SumIfs(C:C, A:A, "DENTAL CARE", B:B, "SPOUSE")[/color]
(Note: It is case-independent)

[tt][blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Thanks John - knew it existed but my usage of 2007/2010 is limited at the mo

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
There is a Conditional Sum Wizard in Excel under the Tools menu (You may have to download it from MS). You can have multiple conditions.It steps you thru the process and creates the formula for you.
This is what it created.

{=SUM(IF($A$2:$A$4="dental care",IF($B$2:$B$4="spouse",$C$2:$C$4,0),0))}

Notice the brackets outside that indicate an array.
FYI You can use CTRL+SHIFT+ENTER to create arrays
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top