I am using Excel and VBA for D&D and have made a world map seperating resources between different cells. I am using this to calculate the distance between the towns and the resources, so that I can calculate the price per pound of the resource.
In order to find the distance between two points (the resource and the town) I use this formula:
This finds the hypotenuse between the two points, using the columns and rows difference as the other sides of the triangle.
However, I need to go one step further and have a means to tell whether the hypotenuse travels through water tiles or land.