# Issues in Calculating Weeks

• 0
• Question
• Updated 3 years ago
I am deriving store launch date by using following in a formula field.

Launch/Relanch: If(

[Banner] <> "Woolworths", [Building Comp Date],

not IsNull([Marketing Launch]), [Marketing Launch],

As I needed to get 'week to launch', I used the following formula.

Weeks to Laumch: ToWeeks (Launch/Relaunch)

But I could not get this working.  Then I decided to use a different approach by calculating launch/relaunch date as well as weeks in the same formula by using the following and it still does not work for me.

Weeks to Launch: If(

[Banner] <> "Woolworths", ToWeeks([Building Comp Date])-Today(),

not IsNull([Marketing Launch]), ToWeeks([Marketing Launch])-Today(),

Not too sure what is need to calculate weeks?
• 3,152 Points

Posted 3 years ago

• 0
• 70,394 Points
When you say it is not working, what are the symptoms of the problem.
Mark
• 3,152 Points
Thanks Mark. It says function is defined to be in ToWeeks(Duration d).  You may need to do one of the following: Choose the right number and type of agreement etcetc./
• 70,394 Points
I think it's misplaced brackets on the first two lines.
try this

If(
[Banner] <> "Woolworths", ToWeeks([Building Comp Date]-Today()),

not IsNull([Marketing Launch]), ToWeeks([Marketing Launch]-Today()),

• 3,152 Points
Thanks. Tried it. Now I am getting an issue with Weekdayadd function.  Bad or missing arguments in function call.
• 70,394 Points
This should work
If(
[Banner] <> "Woolworths", ToWeeks([Building Comp Date]-Today()),

not IsNull([Marketing Launch]), ToWeeks([Marketing Launch]-Today()),

• 3,152 Points
Thank you kindly.  But I still have the same error. Could this be that approved completion date is a formula date field?
• 70,394 Points
No, that is not why.  Can you post your exact formula?
• 3,152 Points
Thanks.  So the field is numeric:

If(
[Banner] <> "Woolworths", ToWeeks([Building Comp Date]-Today()),

not IsNull([Marketing Launch]), ToWeeks([Marketing Launch]-Today()),

• 70,394 Points
more problems with placement of brackets

If(
[Banner] <> "Woolworths", ToWeeks([Building Comp Date]-Today()),

not IsNull([Marketing Launch]), ToWeeks([Marketing Launch]-Today()),

ToWeeks(
Days(