Using SETATREF with "IF" function isn't as obvious as one might expect. It is a little quirky. Normally, the syntax would be: IF(test condition, do IF true, do IF false).
So, let's say you want to set one parameter if true, and another if false. Based upon syntax, the temptation would be: IF(test condition, SETATREF(User.R1,SETATREFEXPR()), SETATREF(User.R2,SETATREFEXPR())). The expectation is that if the test condition is TRUE, then the 1st SETATREF is used, and if FALSE, the 2nd SETATREF is used. Well, this syntax has the unexpected result of setting both User.R1 and User.R2, regardless of the text condition. SETATREF just fires. That just the way it is.
The solution is to modify the SETATREF statement: SETATREF(IF(test condition, User.R1, User.R2),SETATREFEXPR()). Since SETATREF always fires, then the target intermediary must change to correctly direct the intercept action. Moving the IF statement inside the SETATREF, guarantees that it always is evaluated. Thus, based upon the test condition, either User.R1 or User.R2 will be the selected intermediary.
Note, it may be necessary to wrap the SETATREFEXPR() with the SETATREFEVAL, depending upon how things are triggered. If the formula is in the cell that is being changed, the "eval" is optional. If some other cell is the trigger, the "eval" is required. This is demonstrated in the previously attached Visio file. The full syntax would be: SETATREF(IF(test condition, User.R1, User.R2),SETATREFEVAL(SETATREFEXPR())).
HTH
Wapperdude