sumif and countif using corresponding ranges

snowman1976

Board Regular
Joined
Nov 4, 2008
Messages
191
hello
i am trying to figure out how to do countifs, and sumifs by comparing two ranges.
I am hoping to do this without a 'helper' column, because I have to do this on a bigger scale.

below is my small example. I want to compare the numbers in the quantity column to the target.
1st I need to COUNT the number of times a quantity is equal or greater than the corresponding target.
2nd I need to SUM if the quantity is less than than the corresponding target.


ITEMTargetQuantity
A23
B21
C31
D12
E22
F11
G54
4count number of times quantity >= corresponding target
6sum of the quantities less than target (not count)
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
How about
+Fluff New.xlsm
ABC
1ITEMTargetQuantity
2A23
3B21
4C31
5D12
6E22
7F11
8G54
9
10Count >=4
11Sum <6
Lookup
Cell Formulas
RangeFormula
C10C10=SUMPRODUCT(--($C$2:$C$8>=$B$2:$B$8))
C11C11=SUMPRODUCT((C2:C8<B2:B8)*(C2:C8))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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