WHATIF

WHATIF(tasks, field, value, …)

Asks CPM to date the schedule again with some inputs changed: a task takes longer, moves to another calendar, or the data date moves. The result is a whole schedule, not a value, so it never stands on its own: you read a field from it with IN. It is a real CPM run with the project's own calendars, constraints and progress rules, so a delay travels exactly as it would if you made the change in the grid.

Arguments

ArgumentWhat to give it
tasksThe tasks to change: one task (Task("A1000"), or [Task] for this row's task), or a set (All, FILTER(All, …), Predecessors).
fieldWhat to change on them: [Duration], [Remaining duration], [Constraint], [Constraint date] or [Calendar]. Nothing else can be changed (what a what-if can change).
valueThe new value, worked out for each task being changed: in [Duration] * 1.2, [Duration] is that task's own. A duration, a constraint name, a date, or a calendar's name; BLANK() clears a constraint or its date.
…More fields and values for the same tasks, then more groups of tasks, then any number of SETTING pairs for project settings. When two groups change the same task's field, the later one wins.

Examples

Formula
=IN(WHATIF(Task("BDC_001"), [Duration], [Duration] + 10d), [Finish date])

Each task's finish if BDC_001 takes ten more days than planned.

Formula
=LET(w, WHATIF(Task("A1000"), [Constraint], "Start on or after", [Constraint date], ADDWORK([Start date], INPUT("Slip by"))), WORKDAYS([Finish date], IN(w, [Finish date])))

How far each task moves if A1000 starts late by the amount in the Slip by input. A start is moved with a constraint, since dates themselves are CPM's output.

Formula
=IN(WHATIF(FILTER(All, All[Discipline] = "Electrical"), [Remaining duration], [Remaining duration] * 1.2), Task("FINISH")[Finish date])

When FINISH lands if every electrical task runs 20% slower. The same what-if on every row, so it is one CPM run.

Formula
=IF([Critical], WORKDAYS(Project[Finish date], IN(WHATIF([Task], [Remaining duration], [Remaining duration] + 1h), Project[Finish date])))

DCMA's critical path test: for each critical task, how far the project finish moves when that task alone takes an hour longer. Naming [Task] makes one what-if for each row: see One what-if, or one per row.

Formula on WBS rows
=IN(WHATIF(Tasks, [Remaining duration], [Remaining duration] * 1.2), Project[Finish date])

On a WBS row: the project finish if every task in the node and below it ran 20% slower.

Reach for something else when

You wantUse
A value read from the what-ifIN
A project setting changed: the data date, a must-finish-by date, float to a taskSETTING, inside the WHATIF
The plan as it was baselined, not as it would beBASELINE
A named revision or a scenario someone savedSCHEDULE
A rough row-by-row estimate without re-running CPMA self-reading column: see Columns that read themselves

Common questions

Why can't I change a task's finish date?

Dates are what CPM works out, so a what-if changes what CPM starts from. The editor says: “[Finish date] can't be changed in a what-if. These can: Duration, Remaining duration, Constraint, Constraint date, Calendar”. To make a task start later, give it a “Start on or after” constraint, as in the second example.

The editor refuses this
=IN(WHATIF(Task("A1000"), [Finish date], DATE(2026, 3, 2)), [Finish date])

Is there a SLIP function?

No. Every what-if is this one function: a slip is a longer duration or a later constraint. Float to a task is FLOATTO, which you can read in a what-if like any other value: IN(WHATIF(…), FLOATTO(Task("MS_SUB"))).

Why is Upstream refused as the tasks to change?

Naming the row's tasks makes a separate CPM run for every row, so they must be the row's own task or one step from it. The editor says: "The tasks a what-if changes for each row must be the row's own task or one step from it: [Task], Predecessors or Successors on a task; …". All, Task("…") or FILTER(All, …) make one what-if shared by every row instead.

The editor refuses this
=IN(WHATIF(Upstream, [Duration], 5d), [Finish date])

Can I compare two what-ifs?

Yes, side by side, never one inside the other ("A what-if can't be made inside another what-if or inside IN"). Name both with LET and compare what you read from them: LET(a, WHATIF(…), b, WHATIF(…), WORKDAYS(IN(a, [Finish date]), IN(b, [Finish date]))).

Can I read one of my formula columns in a what-if?

No. The what-if dates the schedule again, not your columns, so inside IN over a what-if only built-in fields and attributes can be read. Read the column outside IN and combine the two there.