A simplified version of my problem is that on a different sheet called Sheet2 I have data that I want to average:
=AVERAGE(Sheet2!$A$1:Sheet2!$A$100)
Depending on where the code above is used I need to exchange column A for another letter, for example column D. To do this I have created a function:
=MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ",4,1)
which will output D.
My problem is that instead of having to write:
=AVERAGE(Sheet2!$D$1:Sheet2!$D$100)
I want to use:
=AVERAGE(Sheet2!$MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ",4,1)$1:Sheet2!$MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ",4,1)$100)
but Excel does not accept this. How can I use functions next to Sheet2!?