# Sum if

##### Board Regular
Hi! I want to check column B. If there are observation in B that are smaller than A2 then I want to sum them and place them in C. This formula works for me:

=SUM.IF(\$B\$2:\$B\$265;"<2";\$C\$2:\$C\$265)

However then I cannot have a variable instead of 2. I want to write:

=SUM.IF(\$B\$2:\$B\$265;<A2;\$C\$2:\$C\$265)

### Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Instead of a definate value, why not reference a cell where you can have a variable ?

I'm afraid your 2nd formula didn't show correctly in the post so this is a guess.
Code:
=SUM.IF(\$B\$2:\$B\$265;"<" & A2;\$C\$2:\$C\$265)

yes! that is what I want but i cannot get the syntax to work. I try writing:

=SUMMA.OM(\$B\$2:\$B\$265;<A2;\$C\$2:\$C\$265)

missing code

=SUMMA.OM(\$B\$2:\$B\$265;<A2;\$C\$2:\$C\$265)

is the code that i am trying to write.

Try...

=SUMMA.OM(\$B\$2:\$B\$265;"<"&A2;\$C\$2:\$C\$265)

Hope this helps!

Replies
2
Views
307
Replies
2
Views
220
Replies
2
Views
130
Replies
3
Views
272
Replies
0
Views
121

1,219,905
Messages
6,150,905
Members
450,991
Latest member
ExcelDoer

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