Conditional Sum

Travis

Well-known Member
Joined
Feb 26, 2002
Messages
1,711
Im trying to sum column B based on the values in column A. For example, using the table below I want the sum of the values in column B, where there is a 1 in coumn A. So in this case the result would be 5+7=12
A B
1 5
2 10
1 7
3 8

I used the conditional sum wizard which works and puts this in the cell:
{=SUM(IF($A$2:$A$5=1,$B$2:$B$5,0))}
but I cant copy it or modify it because it removes the outside brackets...Im not sure what those are for...I need to do this about 50 different ways and didnt want to use the wizard every time.

Please help, thanks
Travis
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

zzydhf

Board Regular
Joined
Apr 10, 2002
Messages
236
Welcome to the board!
sumif is an excel function, so for 1 criteria the Ctrl+Shift+Enter is not needed. Just use:
=SUMIF(A2:A5,1,B2:B5) hit enter. (modify as needed)

If more than 1 criteria is needed, then it becomes a CSE formula
 

Mark W.

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,654
The outermost braces are automatically added when you array-enter the formula using the key combination...

Control+Shift+Enter

For more information about array formulas see the Excel Help topic for "About array formulas and how to enter them".
 

Forum statistics

Threads
1,144,059
Messages
5,722,272
Members
422,419
Latest member
Havok390

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
Top