ARGMAX
ARGMAX(set, list)
The row of a set with the largest value, such as the upstream task that finishes last, so you can read any of its fields. The list must be a column of that same set (ARGMAX(Upstream, Upstream[Finish date])): it says which value to rank each row by. Blank values are skipped, a tie goes to the first row in schedule order, and an empty set gives blank.
Arguments
| Argument | What to give it |
|---|---|
| set | A set of rows: Predecessors, Upstream, Assignments, FILTER(…). |
| list | A column of that set to rank by: numbers, durations, dates, text or a status. Written through the same set, e.g. Upstream[Finish date]. |
Examples
Formula=ARGMAX(Predecessors, Predecessors[Finish date])[Task code]
The predecessor that finishes last: on finish-to-start logic, usually the one holding this task back.
Formula=ARGMAX(Assignments, Assignments[Budgeted units])[Resource]
The resource with the most hours on the task.
Formula on WBS rows=ARGMAX(Tasks, Tasks[Duration])[Task code]
On a WBS row: the longest task in the node and below it.
Measure (on the project)=ARGMAX(Tasks, Tasks[Finish date])[Name]
As a measure: the name of the task that finishes last in the project.
Reach for something else when
| You want | Use |
|---|---|
| The largest value itself, not its row | MAX |
| The row with the smallest value | ARGMIN |
| The predecessor that actually drives the task | FIRST(DrivingPredecessors): see FIRST, or the [Driver] field |
| A row's position among the others | RANK |
Common questions
Why does the editor say "ARGMAX needs the set and a column of it"?
The list wasn't read from the set, or it is TRUE/FALSE, which has no largest. Rank by a column of the set itself:
The editor refuses this=ARGMAX(Upstream, Upstream[Critical])[Task code]
To pick among critical tasks, filter first: LET(u, FILTER(Upstream, Upstream[Critical]), ARGMAX(u, u[Finish date]))[Task code].
Why isn't the last finisher always the driver?
Lags, start-to-start and finish-to-finish links and constraints can make another predecessor the one that sets the date. The [Driver] field and DrivingPredecessors follow CPM's own answer.
