Count Filtered Visible Items that Match Numeric Criteria between two ranges

  • Thread starter Thread starter Sam via OfficeKB.com
  • Start date Start date
S

Sam via OfficeKB.com

Hi All,

I'm using the Formula below to give me a static count of numeric values that
fall within a specified range; say 50-75 inclusive. These ranges are housed
in cell X$1. The Named Range "Data" is a dynamic 9 column range spanning many
rows. Named Range "Data" is defined as
=OFFSET(Sheet1!$H$15,0,0,COUNT(Sheet1!$H:$H),9)

Static Count:
=COUNTIF(Data,">="&LEFT(X$1,2))-COUNTIF(Data,">"&RIGHT(X$1,2))

Based on the above can anyone provide a Formula that provides a Dynamic Count
when "Data" is filtered.

Thanks
Sam
 
Try...

=SUM(IF(SUBTOTAL(3,OFFSET(Data,ROW(Data)-MIN(ROW(Data)),0,1)),IF(Data>=LE
FT(X$1,2),IF(Data<=RIGHT(X$1,2),1))))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Actually, since Data contains numeric values, the values returned by
both the LEFT and RIGHT functions need to be coerced into numerical
values. Therefore...

LEFT(X$1,2)

should be

LEFT(X$1,2)+0

and

RIGHT(X$1,2)

should be

RIGHT(X$1,2)+0

Hope this helps!
 
Hi Domenic,

Thanks for reply. The Formula is not returning the desired result. It
returns zero.

Further help appreciated.

Cheers,
Sam
 
Hi Domenic,

Sorry, didn't see your amendment before I posted. The Formula works fine with
this amendment.

Thanks again for your assistance.

Cheers,
Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top