Forum Discussion
advaepfg98gaegv
May 04, 2022Copper Contributor
Referring on previous task's custom field in formula
Hi everybody!
I need to set indicators in custom fields that would implement a comparison of the custom field Number1 from the current task with Number1 from the previous task. How can I set a link in a formula to another task?
Details:
If the finish deviation of task #2 is 5% greater than the finish deviation of task #1, then I need a yellow indicator. My boss wants to see the variance trend, whether it's growing or not.
I don't know how to refer to the previous task field in the custom field formula.
Thanks!
5 Replies
- John-projectSilver Contributor
advaipfg98...
Unlike Excel, formulas in Project's custom fields can only reference data on one task line. To do what you want will require some VBA. I can help you with that if you want.Or, you might want to consider creating a custom report. For example, here is a simple plan
And here is a custom report showing the trend
John- advaepfg98gaegvCopper ContributorYea, John, tell me please how I can make it? Can you show an example of VBA code? What VBA function you think I must use?
Regards!- John-projectSilver Contributoradvaepfg98...
It won't be just a simple or single function in VBA. There are several things to consider. For example, what if the adjacent task line is a summary line? What if the adjacent task has no direct relationship to the task of interest (e.g. on a different logical path)?
Comparing the finish variance of adjacent tasks is a dubious metric at best. What exactly is your boss trying to accomplish? There are better ways (best practice) to see the "trend" of a plan. For example, critical path analysis or earned value metrics.
I can certainly write code to do what you requested but I'll need some ground rules (e.g. first paragraph above) and a sample of your file.
John