Search code examples
google-sheetsrange

Google Sheets: How to count cells in range that contain a formula (not literal)


In google sheets I'm trying to see whether there are any formulas in a range of cells (a count of cells with formulas would be nice, though not necessary).

In column A:

Foo
2
=1+2

I've tried:

=ISFORMULA(A1:A3)
=OR(ISFORMULA(A1:A3))
=ARRAYFORMULA(ISFORMULA(A1:A3))

and they all return FALSE

I expected to get TRUE. It appears that it only tests the first cell in the range.

What other options are there using a range in a formula?


Solution

  • You can use MAP to check all cells. If it's a formula, you can set the value to 1, and then sum the values:

    =SUM(MAP(A1:C, LAMBDA(each,IF(ISFORMULA(each),1,0))))