Sum if

nada

Board Regular
Joined
Jul 4, 2006
Messages
193
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)

but that does not work. Please help! Thanks alot!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

SteveO59L

Well-known Member
Joined
Apr 21, 2004
Messages
7,896
Instead of a definate value, why not reference a cell where you can have a variable ?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
nada

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)
 

nada

Board Regular
Joined
Jul 4, 2006
Messages
193
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)

but that gives me error. Please help me!!
 

nada

Board Regular
Joined
Jul 4, 2006
Messages
193

ADVERTISEMENT

missing code

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

is the code that i am trying to write.
 

nada

Board Regular
Joined
Jul 4, 2006
Messages
193
hi Norie! no i did not get that to work. But that is what I want to do. please please help me!
 

Forum statistics

Threads
1,141,592
Messages
5,707,287
Members
421,500
Latest member
Alex2302

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