# Get %Complete Info for a Task from Its Summary Task • ### Question

• Think of a Summary Task that contains a four step sequential process as its Tasks. Something like this:

25%             1      Name of Process

100%           1.1   Step 1 of Process

0%               1.2   Step 2 of Process

0%               1.3   Step 3 of Process

0%               1.4   Step 4 of Process

What I would like to do is have Text1 in the "Name of Process" line say "Step 1 of Process" because the % Complete in steo 1.1 is 100%.

How do I code for that?

JFitch

Saturday, May 27, 2017 3:13 PM

• Jfitch,

So if a step is complete the summary line Text1 field will replicate the task name of that step but if a step is started but not yet complete, the summary line Text1 will say "Step X in Progress", Right?

If that's the case, then this is possible with a couple of custom fields or VBA. Which would you prefer?

Here's one way to do it with custom field formulas:

Number1=switch([% Complete]=100,1,[% Complete]=0,0,([% Complete]>0 And [% Complete]<100),0.5)

Calculation for task and group summary rows = "sum"

Text1=IIf([Outline Level]=1,(Switch([Number1]=1,"Step 1 of Process",[Number1]=1.5,"Step 2 in Progress",[Number1]=2,"Step 2 of Process",[Number1]=2.5,"Step 3 in Progress",[Number1]=3,"Step 3 of Process",[Number1]=3.5,"Step 4 in Progress",[Number1]=4,"Step 4 of Process")),"")

Calculation for task and group summary rows = "use formula"

Note: you can tweak the string values in the Text1 field formula to parrot the task Name field if desired.

John

• Edited by Saturday, May 27, 2017 8:28 PM formula soln
• Marked as answer by Sunday, May 28, 2017 5:02 AM
Saturday, May 27, 2017 7:55 PM

### All replies

• JFitch,

Okay, so then what does Text1 of the summary line say when step 1 is 100% and step 2 is say, 50%?

Note, this may require some VBA but it possibly could be done with a custom field formula depending on what you want.

John

Saturday, May 27, 2017 4:14 PM
• Text1 in the WBS 1 line would say "Step 2 In Progress"

The idea is that the Summary Task acts as a record to show what step of the process is active.

JFitch

Saturday, May 27, 2017 4:28 PM
• Jfitch,

So if a step is complete the summary line Text1 field will replicate the task name of that step but if a step is started but not yet complete, the summary line Text1 will say "Step X in Progress", Right?

If that's the case, then this is possible with a couple of custom fields or VBA. Which would you prefer?

Here's one way to do it with custom field formulas:

Number1=switch([% Complete]=100,1,[% Complete]=0,0,([% Complete]>0 And [% Complete]<100),0.5)

Calculation for task and group summary rows = "sum"

Text1=IIf([Outline Level]=1,(Switch([Number1]=1,"Step 1 of Process",[Number1]=1.5,"Step 2 in Progress",[Number1]=2,"Step 2 of Process",[Number1]=2.5,"Step 3 in Progress",[Number1]=3,"Step 3 of Process",[Number1]=3.5,"Step 4 in Progress",[Number1]=4,"Step 4 of Process")),"")

Calculation for task and group summary rows = "use formula"

Note: you can tweak the string values in the Text1 field formula to parrot the task Name field if desired.

John

• Edited by Saturday, May 27, 2017 8:28 PM formula soln
• Marked as answer by Sunday, May 28, 2017 5:02 AM
Saturday, May 27, 2017 7:55 PM
• Clever!

What would your VBA approach be?

JFitch

Sunday, May 28, 2017 5:02 AM
• fitcja,

Very similar to the above except there is no need for a custom number field.

The upside of using custom fields with formulas is that they respond immediately whereas with a macro, the user must initiate the macro to see the results. You could use an Event driven macro that would run automatically but it is a more complicated process.

John

Sunday, May 28, 2017 1:19 PM