Sum If Two Conditions Are Met

ExcelGuruWannaBe

New Member
Joined
Mar 18, 2011
Messages
8
I am trying to write a formula that will look at two conditions. I currently have valid data in cells A & I 1-538. Cells A & I 539-1038 have either 0 or N/A that I will use for future adds. Any way I can get this formula to work with that? It currently returns an N/A.

=SUM((--(Master!$A$3:$A$1038="X")*--(Master!$I$3:$I$1038="HIGH")))

Thanks,
WannaBe
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
What are you actually adding? If you just want to count the number of records that match the conditions, this will work:
=sumproduct(--(range1=condition1),--(range2=condition2))

If you want to sum values associated with those ranges, use:
=sumproduct(--(range1=condition1),--(range2=condition2),range3)
 
Upvote 0
Try:

=SUMPRODUCT(--ISNUMBER(MATCH("X",Master!$A$3:$A$1038,0)),--ISNUMBER(MATCH("HIGH",Master!$I$3:$I$1038,0)))
 
Upvote 0
Thanks!

I am trying to count the number of times that both conditions are met.

Asator - I am now getting a #value error

NBVC - I keep getting 1 as the response.

Thanks for all of your help!
 
Upvote 0
Yes, probably should've been more like:

Code:
 =SUMPRODUCT(--ISNUMBER(MATCH(Master!$A$3:$A$1038,{"X"},0)),--ISNUMBER(MATCH(Master!$I$3:$I$1038,{"HIGH"},0)))

wasn't thinkin straight enough... ;)
 
Upvote 0
You might also be able to use a sumifs or countifs function, depending what you need.

If the value you want to sum is based on meeting either criteria you could use this, where column J would have the actual values that would be added:
=sumifs(J3:Master!j1038,Master!A3:A1038,"X",Master!I3:I1038,"High")

But if you just wanted to count the amount of cells with X or High depending you could use this:
=Countifs(Master!A3:A1038,"X",Master!I3:I1038,"High")

This may or may not cover what you're looking for but I hope it helps!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top