Count between

Mike7

Board Regular
Joined
Dec 27, 2002
Messages
98
Hi.
This formula:
=SUM(INDEX(($AR$2:$AR$1001=5)*(B2:B1001<11),0,1))
I use to count numbers less than 11 in the range B2:AO1001 and if same row number in the column AR = 5.
How can I count greater than 10 and less than 21 instead 0f <11 ?

Thanks.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi.
This formula:
=SUM(INDEX(($AR$2:$AR$1001=5)*(B2:B1001<11),0,1))
I use to count numbers less than 11 in the range B2:AO1001 and if same row number in the column AR = 5.
How can I count greater than 10 and less than 21 instead 0f <11 ?

Thanks.

You are invoking a syntax that avoids "confirming with control+shift+enter".

Set up in the normal form, that would be:

=SUM(IF($AR$2:$AR$1001 = 5, IF($B$2:$B$1001 < 11, 1)))

which, as said, requires confirming with control+shift+enter, not just with enter.

The new query:

=SUM(IF($AR$2:$AR$1001 = 5, IF($B$2:$B$1001 > 10, IF($B$2:$B$1001 < 21, 1))))

which you need to confirm with control+shift+enter, not just enter.
 
Upvote 0
Hi.
This formula:
=SUM(INDEX(($AR$2:$AR$1001=5)*(B2:B1001<11),0,1))
I use to count numbers less than 11 in the range B2:AO1001 and if same row number in the column AR = 5.
How can I count greater than 10 and less than 21 instead 0f <11 ?

Thanks.
What version of Excel are you using?

If you're using Excel 2007 or later...

=COUNTIFS(B2:B1001,">10",B2:B1001,"<21",AR2:AR1001,5)

This one will work in any version of Excel:

=SUMPRODUCT(--(B2:B1001>10),--(B2:B1001<21),--(AR2:AR1001=5))



Better to use cells to hold the criteria:
  • A2 = 10
  • A3 = 21
  • A4 = 5
=COUNTIFS(B2:B1001,">"&A2,B2:B1001,"<"&A3,AR2:AR1001,A4)

=SUMPRODUCT(--(B2:B1001>A2),--(B2:B1001 < A3),--(AR2:AR1001=A4))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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