Niklas
Niklas

Reputation: 405

COUNTIF with a formula in the criteria

I want to count the value of each row in column C, but only if the date is less than 30 days old (date in column A).

I tried the following myself, but it seems like you cannot use formulas in the criteria in the function COUNTIF.

=COUNTIF( C:C; (TODAY()-A:A)<31 )

So my thought process was to take today's date and subtract the date in the row, giving me the number of days the row is. But that did not work.

Anyone know how I could achieve this another way, or if I am doing this the wrong way?

Upvotes: 1

Views: 70

Answers (1)

player0
player0

Reputation: 1

use:

=COUNTA(IFNA(FILTER(C:C; (TODAY()-A:A)<31)))

or:

=SUM(IFNA(FILTER(C:C; (TODAY()-A:A)<31)))

Upvotes: 2

Related Questions