Problem with IF statement

M

MikeM

I have a custom property Sex. Type 1, Format is M. F.

I want to change the line color to blue or pink, so in Line Format I have:

=IF(Prop.Sex="M",4,RGB(218,80,176))

It doesn't work!!
what is the problem?

Mike
 
M

MikeM

Never mind; I found out that I should have used:

=IF(Prop.Sex=0,4,RGB(218,80,176)), since the relevant factor is not the name
of the listed factors but their index no.

Mike
 
C

Chris Roth [MVP]

Mike,

All strings are 0. This probably won't work either.

Usually, you want to use the semicolon for your format list

Prop.Sex.Format = "M;F"

And you need to use the LOOKUP function to figure out what's been selected:

User.isM =( LOOKUP(Prop.Sex,Prop.Sex.Format,",") = 0 )

Ie: is the 0th item selected. ...=1 to check for "F" instead.

The "," argument is optional and specifies the list-separator. If you use
the ";", then you don't need to specify the separator.

Also, check out the STRSAME function...

--
Hope this helps,

Chris Roth
Visio MVP

More Visio shapes, articles, development info and pure diagramming fun at:
www.wanderkind.com/visio
 

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