Conditional Counting using worksheet function..

allanTeh

New Member
Joined
Jun 29, 2006
Messages
43
I have 2 Columns A and B with following values:

Values in Cells A2 to A11 are:
1.30
1.35
1.31
1.41
1.40
1.31
1.41
1.30
1.40
1.35

Values in Cells B2 to B11 are:
4
4
3
4
4
4
3
2
2
1

The result I need is :

If range in Column A (A2 to A11) = 1.31 to 1.40,
count the NO OF CELLS in Column B (B2 to B11) where the value = 4.

QUESTION: How to use worksheet function to do it?

(The correct answer should be 3)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this:
Code:
=SUMPRODUCT(--(A1:A10<=1.4),--(A1:A10>=1.31),--(B1:B10=4))
 
Upvote 0
Try:

=SUMPRODUCT(--(A1:A10<1.5),--(A1:A10>1.30),--(B1:B10=4))
 
Upvote 0
BOTH answers given above NOT working !!

Is it because cell format have to be of certain type to make the answer given SUMPRODUCT to work?
 
Upvote 0
With the possible exception of numbers formatted as text, no.

But you should adjust for your actual range:
=SUMPRODUCT(--(A2:A11<=1.4),--(A2:A11>=1.31),--(B2:B11=4))

Note however that you can't use entire columns with SUMPRODUCT.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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