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

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.

SteveO59L

Well-known Member
Joined
Apr 21, 2004
Messages
7,899
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,353
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
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!
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,527
Office Version
  1. 365
Platform
  1. Windows
Try...

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

Hope this helps!
 

Forum statistics

Threads
1,176,452
Messages
5,903,181
Members
435,014
Latest member
chriswind

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