Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have been trying to change the colour of a textbox according to a certain condition. Unfortunately it does not seem to work when I have "AND" conditions under an IF statement. The expression that I cannot make it work is the following:
=IF(Brand='X AND Brand='Z' AND Brand='Y', RGB(0,240,0), RGB(0,39,130))
The problem seems to be in the "AND" since this expression works perfectly well when I only have one condition!
Anyway I need to highlight that text box anytime Brands X, Z and Y are selected simultaneously! Any ideas?
May be try this:
If(
SubStringCount('|' & GetFieldSelections(Brand, '|,|') & '|', '|X|') = 1 and
SubStringCount('|' & GetFieldSelections(Brand, '|,|') & '|', '|Y|') = 1 and
SubStringCount('|' & GetFieldSelections(Brand, '|,|') & '|', '|Z|') = 1, RGB(0,240,0), RGB(0,39,130))
May be try this:
If(
SubStringCount('|' & GetFieldSelections(Brand, '|,|') & '|', '|X|') = 1 and
SubStringCount('|' & GetFieldSelections(Brand, '|,|') & '|', '|Y|') = 1 and
SubStringCount('|' & GetFieldSelections(Brand, '|,|') & '|', '|Z|') = 1, RGB(0,240,0), RGB(0,39,130))
You are missing a single quote on X.
I think you will need an OR instead of an AND - but try it in this way:
=IF(match(Brand, 'X', 'Z', 'Y'), RGB(0,240,0), RGB(0,39,130))
- Marcus
try with
=if(Concat(DISTINCT Brand, '', Brand) = 'XYZ', RGB..., RGB....)
Try this
= if(GetFieldSelections(Brand) = 'X, Y, Z', RGB(0,240,0), RGB(0,39,130))
Thanks a lot to all.
I like this hard code. Let's assume if we do have A-Z then do we require to loop 26 times. Or any other solution to achieve. I appreciate your inputs