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)
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Lewiy

Well-known Member
Joined
Jan 5, 2007
Messages
4,284
Try this:
Code:
=SUMPRODUCT(--(A1:A10<=1.4),--(A1:A10>=1.31),--(B1:B10=4))
 

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,166
Try:

=SUMPRODUCT(--(A1:A10<1.5),--(A1:A10>1.30),--(B1:B10=4))
 

allanTeh

New Member
Joined
Jun 29, 2006
Messages
43
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?
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,088
Messages
5,599,664
Members
414,325
Latest member
kfg1287

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