Home › Forums › Discussion › counting the number of predecessors

- This topic has 12 replies, 4 voices, and was last updated 2 years, 3 months ago by Minerva Goree.

Viewing 13 posts - 1 through 13 (of 13 total)

- AuthorPosts
- tallulahGuest
Hello

I am looking to find a way to use a graphical indicator to show those projects with high numbers of predecessors or successors as I want to be able to easily spot pinch points; but I cant figure out the formula.

Can anyone help?

Larry ChristofaroParticipantFirst obvious question, are you using Project Server and do you want to see that at the project level? If so you can with a bit of knowledge (not technical). You will also need a defined formula more than “high numbers”. I can lay out a description if I’m on the right track.

TallulahGuestThanks for the offer of support!!!! Im using a stand alone MS project 2010. Ive lots of projects listed, each with numerous tasks underneath and Im using this to monitor all the interdependencies etc and the overall portfolio timeline. This is working well. There are many tasks though that have high numbers of predecessors or successors and I want to be able to use a graphical indicator in a custom field to pick out those activities with more than, say 8 predecessors as red or more than 5 as amber. Same for successors. Im new to project though and this formula defeats me.

Very grateful for any support

Larry ChristofaroParticipantThat makes sense. You might be able to do this using VBA but nothing out of the box. I’m not the VBA expert but hopefully someone can answer this better for you.

Tim JonesGuestFollowing up on Larry’s suggestion of a VBA solution, here’s a possible first step:

Create a custom number field ([Number20] for this example) with the following formula: Len([Predecessors])

It will return the number of characters in the string from the predecessor field.

Then you can use a formula like the following and add graphical indicators to flag the pinch points with a RED stoplight indicator:

Switch([Number20]<10,”GREEN”,[Number20]>=10 And [Number20]<=20,”YELLOW”,[Number20]>20,”RED”)

You can adjust the formula depending on the number of lines in your schedule.

Tim JonesGuestThe formula and graphical indicators are in a separate custom text field.

Larry ChristofaroParticipantCreative…I like it!!

TallulahGuestThat totally works – you are amazing!!! Thank you so much xxx

Tim JonesGuestUpdate: This formula is better than the Len([Predecessors]) formula from my initial reply:

IIf(LEN([Predecessors])>0,LEN([Predecessors])-LEN(REPLACE([Predecessors],”,”,””))+1,0)

The Len([Predecessors]) formula returns a count that includes the commas in the string; the new formula removes the commas, adds “1” (because there will be one more predecessor than there are commas), and then takes the difference, returning the exact number of predecessors.

I’m updating this so long after the original post because I recently had a need to use this formula and did a little more searching to find a way to get the exact number of predecessors:)

Tony KGuestTim, thanks for sharing the formula(s) above. Everything works perfectly except the formula you posted on 2/10/2017. Is there something missing from that formula? Any guidance you can provide would be great. Thank you

James MartinMemberUsing Project Pro 2013 stand alone. My solution took me down this path & revised formula.

IIf(LEN([Predecessors])>0;LEN([Predecessors])-LEN(REPLACE([Predecessors];’;’;”))+1;0)

Try that one… It appears to be a syntax issue, replace comma with semi colon and double quotes with single quotes. Original logic is correct.

Timothy JonesParticipantThanks James – looks like a difference between 2013 and 2010 (I’m using 2010 stand alone).

Tony – Sorry I didn’t see this when you posted – hope you have it working now.

Minerva GoreeGuestBelow is the formula that worked for me. I’m using MSP Server 2016.

`IIf(LEN([Predecessors])>0,LEN([Predecessors])-LEN(REPLACE([Predecessors],',',""))+1,0)`

- AuthorPosts

Viewing 13 posts - 1 through 13 (of 13 total)