 # Assign Formula Values Based On Variables

• I have been fighting this problem for a couple of hours now and could use some real help.

I have three variables; Independent variables x & y, and dependent variable z.
x & y can take the values 1,2,3 and can equal each other
z can also take on values 1,2,3 but can never equal x or y.

I tried using if/and statements to solve this (see below), but I would have to do it for each case and it exceeds Excels embedded function limit. Any one have any ideas?

=If(and(B7=1,B10=1),riskduniform(E4:E5),if(and(B7=1,B10=2),3,if(and(B7=1,B10=3),2,if(and(B7=2,B10=2),riskduniform(1,3),if(and(B7=2,B10=1),3,if(and(B7=2,B10=1),3,if(and(B7=3,B10=3),riskduniform(1,2),if(and(B7=3,B10=1),2,if(and(B7=3,B10=2),1)))))))))

Brian

• Re: Assigning Values Based On Two Other Variables

This formula meets your conditions, if the x and y are in A1 and A2
=CHOOSE(MAX(A1,B1),2,3,CHOOSE(MIN(A1,B1),2,1,1))

• Re: Assigning Values Based On Two Other Variables

For one who is not awake yet, what is "riskduniform"...

• Re: Assigning Values Based On Two Other Variables

=if(b7=b10,if(b7=1,...if(b7=2,...if(b7=3....))),if(.............)))))))
this shouldnt work?
regards,

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!