0
votes

I'm trying to use the count function in a sheet (sheet 1) while pulling the info from another sheet (sheet 2) through the IMPORTRANGE function. I've used the function =COUNTIF(IMPORTRANGE("URL","Sheet2!A1:Sheet2!A10"),">0"), however, instead of counting the number of cells from sheet 2 that have a number greater than 0, the cell in sheet 1 with the formula just reads 0.

I've tried using =COUNTA as well, and the cell produces 1 when it should count 10.

How can I fix this?

1

1 Answers

2
votes

first, you need to run importrange in some cell and authorize it:

=IMPORTRANGE("URL", "Sheet2!A1:A10")

then try:

=COUNTIF(IMPORTRANGE("URL", "Sheet2!A1:A10"), ">0")

or:

=INDEX(COUNTA(IFNA(QUERY(IFERROR(IMPORTRANGE("URL", "Sheet2!A1:A10")*1), 
 "where Col1 > 0"))))