You need to sign in to do that
Don't have an account?
GRStevenBrookes
Calculating Week number in month.
Hi,
is there a way of calculating the week in the month (i.e Week 1-5) that an opportunity is marked as closed won.
I gather a formula field is the best way - but cant work out how it would be done?
Thanks in advance for your help.
Not sure but please let me know if this satisfies your requirement :
Replace TODAY() with your date field.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi,
No unfortunatly this does not return the correct data - for example, for an opportunity with a close date of 23/07/2011 it is showing a value of 2 when infact the 23/7 was week 4.
I wonder however ,if their is a way of applying the same logic??
Thanks anyhow.
Steve
This formula :
Is working for me, just wondering if you verify again that date is in format MM/DD/yyyy i.e 07/23/2011 and not 23/07/2011 .
I have entered 07/23/2011 and it is giving me 4 as expected.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Ankit,
wouldn't your formula fail for the 7th, 14th, etc? 7/7=1 and thus would return a value of two, but it should return a value of one. I think you need to use something like:
IF(Ceiling(DAY( ankit__Start_Date__c ) / 7) = 1 , 1, ...
That should return the proper numbers.
Jake, a simple <= solves that problem.
IF(DAY( CloseDate ) / 7 <= 1 , 1 ,
IF(DAY( CloseDate ) / 7 <= 2 , 2 ,
IF(DAY( CloseDate ) / 7 <= 3 , 3 ,
IF(DAY( CloseDate ) / 7 <= 4 , 4 ,
IF(DAY( CloseDate ) / 7 <= 5 , 5 , 0) ))))
CEILING( DAY( CloseDate ) / 7 )