Distance() not calculating correctly

We have an inspection type app where we compare the LAT/LONG of the site being visited to the LAT/LONG of the driver’s phone.

In the example below: Site Geocode (vir_lat_long) represents the site’s lat/long (provided in a table) and further down on the screen is the latitude & longitude of my computer which is correct.

When I use DISTANCE() to calculate the difference in miles I’m getting 5692.02 vs. the actual mileage which is only 4 miles (please see distance calculator below) Can someone assist with what I’ might be doing wrong? Also, I’m needing to check to make sure the distance from the site being inspected isn’t greater than 1 mile from the driver’s phone.

Thanks so much

I was able generate the calculation correctly. Reference the following read on Capturing GPS Location. In my case I separated the latitude from the longitude, applied the LATLOG data type to each field and then combined it in a virtual field. I then used this virtual field to calculate the Distance. https://support.google.com/appsheet/answer/10106789?sjid=2147956383750282616-NA

2 Likes