Pass cell position into LOCalc function

Hi, I want to use the distance (in columns) between two cells in a custom-written function, approximately like this:

Function foo(x, y)
  foo = column(x) - column(y)
End Function

Unfortunately all I could find is how to handle scalars or arrays passed as arguments, I could not find if it’s possible to see where the values come from or any other way to pass cell references. Any hints on this?

It is not possible to get an address of a reference passed to a user function. You need to pass address(es) explicitly, e.g. using ROW()/COLUMN().

Hmm, that’s a real shortcoming, I think. I was hoping to do it in a way similar to e.g. the ROW() function which somehow does exactly this.