ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Countif & ranges consisting of multiple areas (https://www.excelbanter.com/excel-worksheet-functions/6409-countif-ranges-consisting-multiple-areas.html)

Jurry

Countif & ranges consisting of multiple areas
 

I would like to use the COUNTIF function with a range which consists of
multiple areas (which are determined during runtime of a VBA script) as
in the following example:

testrange=A1:A3,A5:A6 <- Determined during runtime!
B1=COUNTIF (testrange,"5")

The above does not work. Does anyone have a workaround?

Thanks in advance,
Jurry.


--
Jurry
------------------------------------------------------------------------
Jurry's Profile: http://www.excelforum.com/member.php...fo&userid=8664
View this thread: http://www.excelforum.com/showthread...hreadid=278230


Frank Kabel

Hi
is there any logic HOWE you determine this range. A better way might be
using SUMPRODUCT with multiple crieria.

"Jurry" wrote:


I would like to use the COUNTIF function with a range which consists of
multiple areas (which are determined during runtime of a VBA script) as
in the following example:

testrange=A1:A3,A5:A6 <- Determined during runtime!
B1=COUNTIF (testrange,"5")

The above does not work. Does anyone have a workaround?

Thanks in advance,
Jurry.


--
Jurry
------------------------------------------------------------------------
Jurry's Profile: http://www.excelforum.com/member.php...fo&userid=8664
View this thread: http://www.excelforum.com/showthread...hreadid=278230




All times are GMT +1. The time now is 05:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com