1

I'd like to count all cells in a range where a given function evaluates to TRUE. The documentation for COUNTIF & COUNTIFS show text-matching and evaluation of =,<>,<,>, but nothing more sophisticated.

Here's an example with the function ISDATE (could be any TRUE/FALSE function) as a sheet or as a table:

A B
1 7/28/2021 <- is a date
2 12/7/1941 <- is a date
3 =TODAY() <- is a date
4 foobar <- is not a date
5 <- is not a date
6 =COUNTIF(A1:A5, "=ISDATE()") <- should evaluate to 3

Is something like that possible?

2
  • I know I could accomplish this with an ISDATE helper column. I'd like to understand what's possible within the COUNTIF condition specifically. (In the real spreadsheet in question, I don't have permissions to add a column.)
    – Jacktose
    Jul 30, 2021 at 1:04
  • It's not possible seeing as that goes against the syntax for criterion support.google.com/docs/answer/3093480?hl=en. "criterion must be a string" Jul 30, 2021 at 21:59

2 Answers 2

0

Change =COUNTIF(A1:A5, "=ISDATE()") to =COUNTIF(B1:B5, TRUE)

This will count how many ISDATE function calls in column B have evaluated to TRUE. Instead of what you were doing which was counting how many times the string =ISDATE() appears in the first 5 cells of column A.

1
  • Thanks, but I'm specifically interested in the form of the COUNTIF condition argument.
    – Jacktose
    Jul 30, 2021 at 1:07
-2
  • Column B =ISDATE(A1)
  • B6 =COUNTIF(B1:B5,TRUE)
1
  • Thanks, but I'm specifically interested in the form of the COUNTIF condition argument.
    – Jacktose
    Jul 30, 2021 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.