Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Question on Scripting

 

  What could be the problem with this script ?

=if(if(Style='TVB' and if(DISPLAY_YEAR='2007',0,(If(DISPLAY_YEAR='2008',1,If(DISPLAY_YEAR='2009',2,If(DISPLAY_YEAR='2010',2,If(DISPLAY_YEAR='2011',3,4)))))),

if(if(Style='RY903C' and (If(DISPLAY_YEAR='2008',0,If(DISPLAY_YEAR='2009',1,If(DISPLAY_YEAR='2010',3,If(DISPLAY_YEAR='2011',4))))),

if(Style='RUSSA1' and If(DISPLAY_YEAR='2010',0,If(DISPLAY_YEAR='2011',1,If(DISPLAY_YEAR='2012',2)))

Regards

Mhatim

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hope I got correctly what you are trying to achieve:

=if(Style='TVB',if(DISPLAY_YEAR='2007',0, If(DISPLAY_YEAR='2008',1,If(DISPLAY_YEAR='2009',2,If(DISPLAY_YEAR='2010',2,If(DISPLAY_YEAR='2011',3,4))))),

if(Style='RY903C',If(DISPLAY_YEAR='2008',0,If(DISPLAY_YEAR='2009',1,If(DISPLAY_YEAR='2010',3,If(DISPLAY_YEAR='2011',4)))),

if(Style='RUSSA1',If(DISPLAY_YEAR='2010',0,If(DISPLAY_YEAR='2011',1,If(DISPLAY_YEAR='2012',2))))))

View solution in original post

6 Replies
swuehl
MVP
MVP

At first glance, some missing brackets (about 4-5 closing)? Then, some of your conditionals are missing a then branch, wich is mandatory.

Not applicable
Author

Thanks for your response

I have changed the If statement to take care of all the conditionals however

When I complete the brackets this what I get

                                                                                                                                                                           Red underline comes before the third bracket at the end.

Please advise.

=if(if(Style='TVB' and if(DISPLAY_YEAR='2007',0,(If(DISPLAY_YEAR='2008',1,If(DISPLAY_YEAR='2009',2,If(DISPLAY_YEAR='2010',2,If(DISPLAY_YEAR='2011',3,4)))))),

if(Style='RY903C' and (If(DISPLAY_YEAR='2008',0,If(DISPLAY_YEAR='2009',1,If(DISPLAY_YEAR='2010',3,If(DISPLAY_YEAR='2011',4))))),

if (Style='RUSSA1' and If (DISPLAY_YEAR='2010',0,If(DISPLAY_YEAR='2011',1,If(DISPLAY_YEAR='2012',2)))))))

MayilVahanan

HI

Try this,

=if(if(Style='TVB' and if(DISPLAY_YEAR='2007',0,(If(DISPLAY_YEAR='2008',1,If(DISPLAY_YEAR='2009',2,If(DISPLAY_YEAR='2010',2,If(DISPLAY_YEAR='2011',3,4))))),

if(Style='RY903C' and (If(DISPLAY_YEAR='2008',0,If(DISPLAY_YEAR='2009',1,If(DISPLAY_YEAR='2010',3,If(DISPLAY_YEAR='2011',4))))),

if (Style='RUSSA1' and If (DISPLAY_YEAR='2010',0,If(DISPLAY_YEAR='2011',1,If(DISPLAY_YEAR='2012',2))))))))

But some condition is missing in some if statement..Please fill it

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
swuehl
MVP
MVP

Hope I got correctly what you are trying to achieve:

=if(Style='TVB',if(DISPLAY_YEAR='2007',0, If(DISPLAY_YEAR='2008',1,If(DISPLAY_YEAR='2009',2,If(DISPLAY_YEAR='2010',2,If(DISPLAY_YEAR='2011',3,4))))),

if(Style='RY903C',If(DISPLAY_YEAR='2008',0,If(DISPLAY_YEAR='2009',1,If(DISPLAY_YEAR='2010',3,If(DISPLAY_YEAR='2011',4)))),

if(Style='RUSSA1',If(DISPLAY_YEAR='2010',0,If(DISPLAY_YEAR='2011',1,If(DISPLAY_YEAR='2012',2))))))

Not applicable
Author

Thanks Ramasamy,

Not able to figure out the missing ones.

Can you please help me with it.

Regards.

Mhatim

robert99
Specialist III
Specialist III

Should you start with two if's (i never do)

=if(Style='TVB' and DISPLAY_YEAR='2007',0,

etc

its

if(a=b and / or c=b etc,then (may include an if), else (may include an if)

if you have more than one if statement the brackets are all maybe closed at the end not part way through

not

If(DISPLAY_YEAR='2011',3,4)))))),

try dropping all if if statement

I don't think this will work at any point in the formula


if(if(Style='RY903C' and

its always if,then,else not if(if

I believe