I need to return a value based on two columns' variables.
Basically, if it's type A in the Type column I need to return a 1 or a 3 in the Ref column based on what's in the limit column. Then if it is type B in the Type column, that row should always be NA in the Ref column.
So in the above table as an example:
row one should return 1 in [Ref]
row two and three should return NA in [Ref]
row four should return 3 in [Ref]