COUNT
COUNT(set_or_list)
Counts the rows in a set, such as a task's successors, or the values in a list that aren't blank. Given a column, it counts only the rows where that column has a value, so COUNT(Predecessors[Actual finish]) is the predecessors that have finished, not all of them.
Arguments
| Argument | What to give it |
|---|---|
| set_or_list | A set of rows, like Successors or FILTER(…), to count every row. Or a column read from a set, like Predecessors[Actual finish], to count the rows where it isn't blank. An empty set counts 0. |
Examples
Formula=COUNT(Successors)
How many successors the task has. 0 marks an open end.
Formula=COUNT(FILTER(Upstream, Upstream[Status] <> "Complete"))
How many unfinished tasks still lead into this one, at any depth.
Formula=COUNT(Predecessors[Actual finish])
How many of the task's predecessors have an actual finish. Compare it with COUNT(Predecessors) to see how many are still open.
=COUNT(FILTER(Tasks, Tasks[Critical]))
On a WBS row: how many critical tasks are in the node and below it.
Reach for something else when
| You want | Use |
|---|---|
| How many different values, not how many rows | COUNTDISTINCT |
| Only whether there are any rows | ISEMPTY |
| Whether any row meets a condition, as TRUE/FALSE | ANY |
| The total of a column, not a count | SUM |
Common questions
Is there a COUNTIF?
No. Filter the rows first, then count them: COUNT(FILTER(All, All[Phase] = "Civil")) is Excel's COUNTIF. The condition can compare with the row you're on, as in COUNT(FILTER(All, All[Phase] = [Phase])).
Why doesn't COUNT of a column match COUNT of its set?
A column counts only the rows where it has a value. Total float, for one, is blank on a complete task, so COUNT(Upstream[Total float]) leaves complete tasks out while COUNT(Upstream) counts them all.
What does "COUNT needs a set or a list, e.g. COUNT(Predecessors)" mean?
COUNT was given a single value, such as one of the row's own fields. There is nothing to count in one value.
The editor refuses this=COUNT([Duration])
To ask whether a field is filled in, use ISBLANK.
