How to use AND logic with STRiff function
How to use AND logic with STRiff function
I want to setup a formula that checks two strings to see if they match two different values & return something if they match or not. How can I do that?
Re: How to use AND logic with STRiff function
You can use StrScan function with StrIFF.
Code: Select all
StrlFF(StrScan('first_string', 'second_string'),'are_different','are_equal','are_different')
Re: How to use AND logic with STRiff function
I need to do that for two separate StrIFF functions.
If String1 = XXX AND string2 = YYY then XYZ
If String1 = XXX AND string2 = YYY then XYZ
Re: How to use AND logic with STRiff function
I figured out a way to do it by adding together StrCompare functions and wrapping their sum into a StrIFF Just in case anyone else runs into this.
Code: Select all
StrIFF( StrCompare('x', 'x') + StrCompare(StrLeft('y', 'y') , '' , 'PRINT' , '' )
Re: How to use AND logic with STRiff function
Be careful when adding the results of two StrCompare( ) calls together, if the first one returns -1 (less than) and the second returns +1 (greater), then the sum will be zero, which will select the central option ('PRINT') in the StrIFF( ) function.
To get around this, use the NumberAbsolute( ) function around each of the StrCompare( ) calls to ensure the two results don't cancel each other out!
Cheers,
To get around this, use the NumberAbsolute( ) function around each of the StrCompare( ) calls to ensure the two results don't cancel each other out!
Cheers,
Terry Phythian
Reprise Consulting
Reprise Consulting
Who is online
Users browsing this forum: [Ccbot] and 0 guests