You need to sign in to do that
Don't have an account?
mw6
how to calculate number of weeks in the current month for salesforce formula
Hi
Can any expert help me to create a formula to calculate the # of weeks in the current month ro create a formula field
Thanks in adv
Can any expert help me to create a formula to calculate the # of weeks in the current month ro create a formula field
Thanks in adv
Why don't you simply tweak the formula like this ?
That should do the trick !
Kindly mark it as an answer if that works !
All Answers
please check with the below link
Apologies, my question was not clear. Currently I am using the below formula. I need to calculate the # of weeks from the 'Session_Start_Date__c till to date. The work arround I am doing currently is change the IF(MOD(YEAR(TODAY()),4)=0, 28, 28), line means change the 28 to 30 or 31. I need help to fix this, so that no need to modify the formula every time.
IF(MOD(DAY(Session_Start_Date__c ),7) == 0, 0, 1)+
FLOOR(DAY(Session_Start_Date__c )/7) +
FLOOR(((
CASE(MONTH(Session_Start_Date__c),
2, IF(MOD(YEAR(TODAY()),4)=0, 28, 28),
4, 30,
6, 30,
9, 30,
11, 30,
31
))-DAY(Session_Start_Date__c ))/7)
Why don't you simply tweak the formula like this ?
That should do the trick !
Kindly mark it as an answer if that works !
(
DAY( Date__c ) +
MOD( DATE( YEAR( Date__c ), MONTH( Date__c ), 1 ) - DATE( 1900, 4, 1 ), 7 )
) / 7
)