How to use the result of a formula as a reference?

I guess the switch function works when you have only a few possible values you need to transform into a reference. In my case it does not help.

The reason why and what I am trying to achieve is best explained in the framework of this discussion though