Using a hardcoded constant such as "60*8*5" is not a good idea. The number of hours in a day or the number of hours in a week is controlled by Tools > Options > Calendar tab.
You should replace the hardcoded constants with either of [Minutes Per Week] or [Minutes Per Day] depending on your circumstances.
Member for
23 years 8 months
Member for23 years8 months
Submitted by Philip Kearney on Fri, 2009-06-26 10:38
If I could claim it as my own I would, but the person you’ll have to buy the beer for is a guy called Jack Dahlgren. He posted it somewhere a few years ago, I can’t remember where, but any formulae I see that may be of use at a later date I tend to squirrel away until it’s needed.
I’ll keep any plaudits for passing it on though ;o)
Regards,
Darren
Member for
23 years 8 months
Member for23 years8 months
Submitted by Philip Kearney on Thu, 2009-06-11 09:01
Had a look at that, Im not sure about that format as I dont understand where first digit is coming from? For example it shows 1/Wk45...? What is with the 1/????
Any ideas?
Member for
23 years 8 months
Member for23 years8 months
Submitted by Philip Kearney on Wed, 2009-06-10 05:03
This sounds like something that is completely unnecessary but was just whimsically dreamed up by your client without any regard for whether it is useful or even possible. But, ultimately, anything is possible if someone is paying for it.
Do you mean the week number since the project start date or the week number of the year?
See Format, Layout for the format of the dates that appear on the bars. There are week number formats at the bottom of the list, but they are the week numer of the year. If its in the drop-down list you can have it and if not then you cant.
Except that if you use a spare Start field and a spare text field you can do the necessary calculation with the available fields and functions, and format it any way you like, and use that field as the left hand bar text in the Bar Styles definition.
Having said how I would go about it, I havent actually done it, but leave it to you or someone who has the spare time to have go. Hope this helps.
Member for
18 years 3 monthsRE: Week Numbers in Bar Styles required
Using a hardcoded constant such as "60*8*5" is not a good idea. The number of hours in a day or the number of hours in a week is controlled by Tools > Options > Calendar tab.
You should replace the hardcoded constants with either of [Minutes Per Week] or [Minutes Per Day] depending on your circumstances.
Member for
23 years 8 monthsRE: Week Numbers in Bar Styles required
Lalit,
thanks for that, I have validated it & it works fine so will be keeping it handy for future reference.
Keep up the fine work, everybody!
Member for
17 years 1 monthRE: Week Numbers in Bar Styles required
Philip,
There can be another simple formula:-
"Wk " & Int(ProjDateDiff([Project Start],[Start],"Standard")/60/8/5)
HTH
Member for
23 yearsRE: Week Numbers in Bar Styles required
Here is the sample file
http://rapidshare.com/files/244313154/Calendar_Weeks.mpp
Member for
23 yearsRE: Week Numbers in Bar Styles required
Hi Darren
thanks for sharing the formula
but when i insert there is 1 week difference
week 50 is showing as 51
when i put a -1 in the formula everything works fine
except week 52 , which becomes CW-0 ??
why ?
any tweaks ?
regards
hemant
Member for
17 years 9 monthsRE: Week Numbers in Bar Styles required
Phillip,
If I could claim it as my own I would, but the person you’ll have to buy the beer for is a guy called Jack Dahlgren. He posted it somewhere a few years ago, I can’t remember where, but any formulae I see that may be of use at a later date I tend to squirrel away until it’s needed.
I’ll keep any plaudits for passing it on though ;o)
Regards,
Darren
Member for
23 years 8 monthsRE: Week Numbers in Bar Styles required
Darren,
If I could, I would drag you to the pub to buy you a few beers for that!
Many thanks for that as it worked!
Member for
17 years 9 monthsRE: Week Numbers in Bar Styles required
Hi Phillip,
Are the Week numbers your client wants displayed the MS Project fiscal year (starts in Jan ends Dec) or from contract award/project start?
For the fiscal year you could customise a spare text field and use this formula
"W" & Format(DateAdd("d",7-Weekday([Finish]),[Finish]),"ww")
Regards,
Darren
Member for
23 years 8 monthsRE: Week Numbers in Bar Styles required
Trevor,
Had a look at that, Im not sure about that format as I dont understand where first digit is coming from? For example it shows 1/Wk45...? What is with the 1/????
Any ideas?
Member for
23 years 8 monthsRE: Week Numbers in Bar Styles required
Trevor,
Thanks for taking the time to explain it twice! LOL!
Yeah, its the weeks of the year I want to put in.
Had a hunch that this was something to calculate but dont have the inclination to go about it as quite busy at work these days!
I will give your idea a go later so thanks again!
Member for
19 years 11 monthsRE: Week Numbers in Bar Styles required
This sounds like something that is completely unnecessary but was just whimsically dreamed up by your client without any regard for whether it is useful or even possible. But, ultimately, anything is possible if someone is paying for it.
Do you mean the week number since the project start date or the week number of the year?
See Format, Layout for the format of the dates that appear on the bars. There are week number formats at the bottom of the list, but they are the week numer of the year. If its in the drop-down list you can have it and if not then you cant.
Except that if you use a spare Start field and a spare text field you can do the necessary calculation with the available fields and functions, and format it any way you like, and use that field as the left hand bar text in the Bar Styles definition.
Having said how I would go about it, I havent actually done it, but leave it to you or someone who has the spare time to have go. Hope this helps.