Author Topic: "IF(cell="text",,)" does not work  (Read 3302 times)

0 Members and 1 Guest are viewing this topic.

TomasL

  • Jr. Member
  • **
  • Posts: 21
    • ENRAD AB
"IF(cell="text",,)" does not work
« on: March 08, 2011, 03:46:13 AM »
In ThePage!Prop.Lang I have Either "SWE" or "ENG"
Now in a shape I have
IF(ThePage!Prop.Lang="SWE","Swedish text", "English Text")

This does not work
Nor does it work if I do the following
Creating a row (User.Lang)
Sets the formula ThePage!Prop.Lang

The row User.Lang shows the correct stuff
But
IF(User.Lang="SWE","Swedish text", "English Text")
Still does not work.
So What am I missing, pretty sure it used to work.

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: "IF(cell="text",,)" does not work
« Reply #1 on: March 08, 2011, 06:41:11 AM »
I recommend you to check STRSAME function for the shapesheet.
« Last Edit: March 08, 2011, 06:21:38 PM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

TomasL

  • Jr. Member
  • **
  • Posts: 21
    • ENRAD AB
Re: "IF(cell="text",,)" does not work
« Reply #2 on: March 08, 2011, 07:04:44 AM »
For some reason, if I put "=LOOKUP(ThePage!Prop.Lang,"SWE;ENG")" in the user section (User.Lang).
And
IF(User.Lang="SWE","SweText","EngText")
WHere I want it, in this case Prop.xxx.format, then it works, very odd in my opinion.

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: "IF(cell="text",,)" does not work
« Reply #3 on: March 08, 2011, 08:08:58 AM »
To compare Strings in the ShapeSheet you must use the StrSame-Funktion, like June said:

If(Strsame(Prop.Lang,"SWE"),"swedish text","engl. text")


The reason why your code above works is that it doesn't truly work.
User.Lang is either 0 or 1 because of the LOOKUP

You so test for example:

If(0="SWE",...

that yields a 1 for error that is interpreted as true from the if. So the working of your solution is an accident  ;)

(It may be the other way round 0<=>false, don't remember)
« Last Edit: March 08, 2011, 08:10:42 AM by Jumpy »

TomasL

  • Jr. Member
  • **
  • Posts: 21
    • ENRAD AB
Re: "IF(cell="text",,)" does not work
« Reply #4 on: March 08, 2011, 08:52:44 AM »
Ok, this must  be new functionality, this function I haven't seen before.

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: "IF(cell="text",,)" does not work
« Reply #5 on: March 09, 2011, 10:39:27 AM »
STRSAME is very old and needed in the ShapeSheet, because you can't compare Strings there:

If("A"="A","A","B") can't work in ShapeSheet!!!

Must be:

If(STRSAME("A","A"),"A","B")