Google-sheets – How to color the target of a SUM formula in Google Sheets
google sheets
If I double click on a formula with a cell range, Google Sheets will outline the target area:
Is there a way to get similar highlighting at all times, updated as the range or ranges in the formulas are updated?
Best Answer
If I read your question correctly, you are looking for a hover "effect".
If that is the case, you can not. (Try visualizing what it would look like -in a common scenario- moving your cursor around a sheet with many long formulas, in close range with inter-lapping ranges and cells like one with 249 ones)
You could send a feature request to Google.
Go to the top menu, Help >> Report a problem and fill out the pop-up form
With a help from a friend, he was able to create the following JavaScript which was imported into Google Sheets' Script Editor and then referenced as =PlanarPolygonAreaMeters2(A1,B1,C1)/1000000
var radiansPerDegree = Math.PI / 180.0;
var degreesPerRadian = 180.0 / Math.PI;
var earthRadiusMeters = 6367460.0;
var metersPerDegree = 2.0 * Math.PI * earthRadiusMeters / 360.0;
var metersPerKm = 1000.0;
var meters2PerHectare = 10000.0;
var feetPerMeter = 3.2808399;
var feetPerMile = 5280.0;
var acresPerMile2 = 640;
function PlanarPolygonAreaMeters2(p1, p2, p3) {
var points = [p1, p2, p3];
Utilities.sleep(1500);
var a = 0.0;
for (var i = 0; i < points.length; ++i) {
var j = (i + 1) % points.length;
var thisPointRaw = points[i];
var nextPointRaw = points[j];
var thisPointLat = thisPointRaw.split(/,/)[0];
var thisPointLng = thisPointRaw.split(/,/)[1];
var nextPointLat = nextPointRaw.split(/,/)[0];
var nextPointLng = nextPointRaw.split(/,/)[1];
var xi = thisPointLng * metersPerDegree * Math.cos(thisPointLat * radiansPerDegree);
var yi = thisPointLat * metersPerDegree;
var xj = nextPointLng * metersPerDegree * Math.cos(nextPointLat * radiansPerDegree);
var yj = nextPointLat * metersPerDegree;
a += xi * yj - xj * yi;
}
return Math.abs(a / 2.0);
}
Best Answer
If I read your question correctly, you are looking for a hover "effect".
If that is the case, you can not.
(Try visualizing what it would look like -in a common scenario- moving your cursor around a sheet with many long formulas, in close range with inter-lapping ranges and cells like one with 249 ones)
You could send a feature request to Google.
Go to the top menu,
Help
>>Report a problem
and fill out the pop-up form