countif within range

palaeontology

Active Member
Joined
May 12, 2017
Messages
444
Office Version
  1. 2016
Platform
  1. Windows
I have a row of data in the range L5:BI5

In CA5 I have a number

In BX5 I have another number

I'd like to count how many values in the initial range L5:BI5 exist between the lower value found in CA5 and the upper value in BX5.

I'm currently using the following ... =COUNTIF($L5:$BI5,AND(">="&$CA5,"<"&$BX5)) ... but it is returning zero.

Any thoughts would be greatly appreciated.

Very kind regards,

Chris
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Don't have Excel at the moment but try...

Code:
=SUMPRODUCT((B2:L15<BX5)*(B2:L15>CA5))
 
Upvote 0
Thanks Michael,

i just suddenly realised i probably should be using countifs, not countif.

Very kind regards,

Chris
 
Upvote 0
Hi,

Michael's formula in Post # 2 didn't display properly, it should have been:

=SUMPRODUCT((B2:L15< BX5)*(B2:L15>CA5))

and here's another option for you:

=COUNTIFS(L5:BI5,">="&CA5,L5:BI5,"<="&BX5)

remove the equal signs if your criteria is Exclusive of the value in CA5 and BX5.
 
Last edited:
Upvote 0
Ooops, forgot about the < signs, remove the spaces around the < & > signs

Code:
=SUMPRODUCT((B2:L15 < BX5)*(B2:L15 > CA5))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

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