Switch formula problem

N

Napone

I'm trying to show an indicator of no entry in the Baseline1 Finish column.
One formula works fine alone but when mixed with other formulas i get nothing.

Formula 1.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No Baseline") works fine.
If I add to the following:

Formula 2.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late by more than
1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review in 7
days",True,"On schedule")

I get nothing as a result. I know formula 2 without formula 1 add on works.
I just combined the two and it doesn't work. Is there a bug in the Switch
formula?

-Napone
 
R

Rod Gill

Hi,

It may try to evaluate all options before selecting the correct switch. THis
would fail for NA dates as datediff doesn't work with them. Solve this by
using an IIF statement. Try:
IIf([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",SWITCH(ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late by
more than 1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review in
7 days",True,"On schedule"))
 
N

Napone

Hi Rod,

It didn't work. Thanks for your quick reply. The IIF and Switch broke the
statement. It didn't sequence to the other value.

-Napone


Rod Gill said:
Hi,

It may try to evaluate all options before selecting the correct switch. THis
would fail for NA dates as datediff doesn't work with them. Solve this by
using an IIF statement. Try:
IIf([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",SWITCH(ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late by
more than 1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review in
7 days",True,"On schedule"))

--

Rod Gill
Project MVP


Napone said:
I'm trying to show an indicator of no entry in the Baseline1 Finish
column.
One formula works fine alone but when mixed with other formulas i get
nothing.

Formula 1.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No Baseline") works
fine.
If I add to the following:

Formula 2.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late by more
than
1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review in 7
days",True,"On schedule")

I get nothing as a result. I know formula 2 without formula 1 add on
works.
I just combined the two and it doesn't work. Is there a bug in the Switch
formula?

-Napone
 
R

Rod Gill

Hmmm, Works on my PC. Check it got copied correctly then try removing the
switch and check the IIF works then add the formula to Text2 and remove the
IIF and make sure the SWITCH works (be sure to save to Baseline1 first).
--

Rod Gill
Project MVP


Napone said:
Hi Rod,

It didn't work. Thanks for your quick reply. The IIF and Switch broke the
statement. It didn't sequence to the other value.

-Napone


Rod Gill said:
Hi,

It may try to evaluate all options before selecting the correct switch.
THis
would fail for NA dates as datediff doesn't work with them. Solve this by
using an IIF statement. Try:
IIf([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",SWITCH(ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late
by
more than 1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review
in
7 days",True,"On schedule"))

--

Rod Gill
Project MVP


Napone said:
I'm trying to show an indicator of no entry in the Baseline1 Finish
column.
One formula works fine alone but when mixed with other formulas i get
nothing.

Formula 1.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No Baseline") works
fine.
If I add to the following:

Formula 2.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late by
more
than
1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review in 7
days",True,"On schedule")

I get nothing as a result. I know formula 2 without formula 1 add on
works.
I just combined the two and it doesn't work. Is there a bug in the
Switch
formula?

-Napone
 
N

Napone

Yes, If I save Baseline1 Finish, the indicator will show up, that works on my
project. What I'm trying to show is the indicator of no saved Baseline1
Finish. I should see a "No Baseline" indicator when just entering a task
name. In this case, I see nothing when formula 1 and 2 combined. Formula 1
works separately. Did you get the "No Baseline" indicator when entering just
the task name?

-Napone

Rod Gill said:
Hmmm, Works on my PC. Check it got copied correctly then try removing the
switch and check the IIF works then add the formula to Text2 and remove the
IIF and make sure the SWITCH works (be sure to save to Baseline1 first).
--

Rod Gill
Project MVP


Napone said:
Hi Rod,

It didn't work. Thanks for your quick reply. The IIF and Switch broke the
statement. It didn't sequence to the other value.

-Napone


Rod Gill said:
Hi,

It may try to evaluate all options before selecting the correct switch.
THis
would fail for NA dates as datediff doesn't work with them. Solve this by
using an IIF statement. Try:
IIf([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",SWITCH(ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late
by
more than 1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review
in
7 days",True,"On schedule"))

--

Rod Gill
Project MVP


I'm trying to show an indicator of no entry in the Baseline1 Finish
column.
One formula works fine alone but when mixed with other formulas i get
nothing.

Formula 1.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No Baseline") works
fine.
If I add to the following:

Formula 2.
Switch([Baseline1 Finish]=ProjDateValue("NA")=-1,"No
Baseline",ProjDateDiff([Baseline1 Finish],[Finish])/480>=2,"Late by
more
than
1 day",ProjDateDiff([Baseline1 Finish],[Finish])/480>-7,"Review in 7
days",True,"On schedule")

I get nothing as a result. I know formula 2 without formula 1 add on
works.
I just combined the two and it doesn't work. Is there a bug in the
Switch
formula?

-Napone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top