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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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
 
Upvote 0
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".
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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