Help.

I use a google sheet where each row contains a pair of coordinates in the UK's Grid system (east & north). These pairs are converted to latitude & longitude by calling a function NEtoLL - shown in outline below.

The intent is to take an east,north pair from adjacent cells in a row and replace the NEtoLL function call and the next cell in the same row with the latitude & longitude values. I used this some years ago and I am sure it all worked OK - but I would say that wouldn't I! 

The PROBLEM ... However now the returned values are being placed in the function call cell and the cell beneath this in the next row. This fails where the next row contains the NEtoLL function call to that rows east, north pair as it cannot overwrite this value.

It does work for the last row where it correctly replaces the function call with the latitude and the cell beneath this with the longitude.

How do I return the values so they are placed in adjacent cells in the same row.

Many thanks
Paul

```
function NEtoLL(east, north) 
{
  // converts NGR easting and nothing to lat, lon.
  // input metres, output signed degrees 
  var nX = Number(north);
  var eX = Number(east);
// ... lots of serious maths code (which I have removed) to convert from UK's Grid Ref System to Lat Long WGS84

  var geo = transform(phip, lambdap, OSGB_AXIS, OSGB_ECCENTRIC, 0, WGS84_AXIS, WGS84_ECCENTRIC, 446.448, -125.157, 542.06, 0.1502, 0.247, 0.8421, -20.4894);

  var res = new Array(2);
  res[0] = geo.latitude * rad2deg;
  res[1] = geo.longitude * rad2deg;

  return res; // return(geo);
}

```