"IF(cell="text",,)" does not work

Started by TomasL, March 08, 2011, 08:46:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TomasL

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.
my sites:
www.ebaman.com www.enrad.se www.tlec.se

JuneTheSecond

#1
I recommend you to check STRSAME function for the shapesheet.
Best Regards,

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

TomasL

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.
my sites:
www.ebaman.com www.enrad.se www.tlec.se

Jumpy

#3
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)

TomasL

Ok, this must  be new functionality, this function I haven't seen before.
my sites:
www.ebaman.com www.enrad.se www.tlec.se

Jumpy

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")