Forum Discussion
JonathanGlaser
Nov 08, 2022Copper Contributor
Creating a customized column to show the four predecessor task types
I would like to insert a column that shows which of the four (4) possible predecessor task types (FS, SS, FF, SF) all the tasks have. Can anyone tell me if this is even possible, and if so, how can ...
- Nov 10, 2022Jonathan,
Okay, then this formula should do it. Note, after posting my first response I realized it was not the Mid function but the Instr function that is needed.
Text1=IIf([Predecessors]<>"",Switch(instr(1,[Predecessors],"S")=0 And instr(1,[Predecessors],"F")=0,"FS",InStr(1,[Predecessors],"SS")>0,"SS",instr(1,[Predecessors],"FF")>0,"FF",instr(1,[Predecessors],"SF")>0,"SF",instr(1,[Predecessors],"FS")>0,"FS"),"")
John
John-project
Silver Contributor
Is it possible? Sure, almost anything is possible.
If there is only one predecessor per task, as in Tasks b thru f below, then it could likely be done with a customized Text field (e.g. Text1) using the Mid function to parse the Predecessor field text string and pick out the dependency type. But, if there are multiple predecessors for a given task, as in Task g, then VBA is required.
But I gotta ask, why in the world do you want that information?
John
JonathanGlaser
Nov 10, 2022Copper Contributor
John-project Thank you, John! This is so helpful.
Please would you help with the formula I need to enter to customize the text field so that I use the Mid function to parse out this information I need (sorry to be a pain)?
Thanks in advance!
Jonathan
- John-projectNov 10, 2022Silver ContributorJonathan,
Well, before we proceed I need to clarify something. Does your file have ONLY a single predecessor for each task? As I noted in my initial response, if any task has more than one predecessor then a custom field formula will not work.
John- JonathanGlaserNov 10, 2022Copper ContributorHi John
Yup - confirming only a single predecessor for each task.
Thanks
Jonathan- John-projectNov 10, 2022Silver ContributorJonathan,
Okay, then this formula should do it. Note, after posting my first response I realized it was not the Mid function but the Instr function that is needed.
Text1=IIf([Predecessors]<>"",Switch(instr(1,[Predecessors],"S")=0 And instr(1,[Predecessors],"F")=0,"FS",InStr(1,[Predecessors],"SS")>0,"SS",instr(1,[Predecessors],"FF")>0,"FF",instr(1,[Predecessors],"SF")>0,"SF",instr(1,[Predecessors],"FS")>0,"FS"),"")
John