# Conditional Sum

#### Travis

##### Well-known Member
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.

Travis

### Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

#### zzydhf

##### Board Regular
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
The outermost braces are automatically added when you array-enter the formula using the key combination...

Control+Shift+Enter

Replies
8
Views
227
Replies
8
Views
865
Replies
5
Views
346
Replies
9
Views
420
Replies
3
Views
419

1,181,242
Messages
5,928,857
Members
436,634
Latest member
JimHHH

### 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.

### Which adblocker are you using?

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

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