sum if

kellshepherd

New Member
Joined
Mar 3, 2002
Messages
1
I have 3 fields.. branch, affiliate, and a number field (mf).

i want to SUM mf IF branch=0001 AND affiliate="Balanced"

How?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
try SUMPRODUCT

if branch is in column A starting at A2 and affiliate is in column B starting at B2 and mf is in column C starting at C2 :

=SUMPRODUCT(($A$2:$A$100="0001")*($B$2:$B$100="Balanced"),($C$2:$C$100))

I use this a lot now and prefer to put the actual variables in their own cells (0001 and "Balanced") so I can just link to them in case I need to change them...... rather than changing the actual formula 100 (or more) times :

=SUMPRODUCT(($A$2:$A$100=F1)*($B$2:$B$100=G1),($C$2:$C$100))

where F1 houses "0001" and G1 houses "Balanced"



ie
 
Upvote 0
On 2002-03-04 10:41, kellshepherd wrote:
I have 3 fields.. branch, affiliate, and a number field (mf).

i want to SUM mf IF branch=0001 AND affiliate="Balanced"

How?

Use...

{=SUM(mf*(branch="0001")*(affiliate="Balanced"))}

...where mf, branch and affiliate are cell ranges with the same dimensions.

Note: This is an array formula which must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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