How to total only when 2 criteria are met?

GLTravis

New Member
Joined
May 13, 2005
Messages
48
I understand sumIF & CountIF to a degree but not sure how to add a total only when 2 criteria are met.
Heres how I see it.
If Row A ="C" & row B = "min charge" add totals in row E.

For that matter id like to know a formula for:- if Cell A5 ="C" & Cell B5="min charge" add totals in row E.
Thanks in advance.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi there,

the most common approach for a 1+ conditional formula is a SUMPRODUCT, so using your example:

=SUMPRODUCT(--($A$1:$A$100="C"),--($B$1:$B$100="min charge"),--($C$1:$C$100))

Important things to note with SUMPRODUCTS are each range must be of equal size (see 1:100) and they can not represent an entire row/column (ie can not use $A:$A or $1:$1), also your totals column (C) must contain only numbers.

You can also use Array formulae (entered with CTRL+SHIFT+ENTER), using the same example:

=SUM(IF($A$1:$A$100="C",IF($B$1:$B$100="min charge",$C$1:$C$100)))

Once array is confirmed the formula will become encased in {...}

SUMPRODUCTS tend to be used more than arrays as they are slightly more robust, if an end user adjusts an array formula they must remember to reset the array at the end (CTRL + SHIFT + ENTER) else the formula will cease to operate correctly - SUMPRODUCT does not require this action.

Here is a good web page outlining use of SUMPRODUCT and how it works etc...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

HTH
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

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