View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Marco similar to a SAS program

In column A I would put the store name or id.
In column B the lattitude
In column C the longitude

Pick a business
Fill column D with the business lattitude (all the same)
Fill column E with the business longitude (all the same)

Fill column F with the distance formula found in:

http://www.cpearson.com/excel/latlong.htm

Finally sort cols A thru F by F descending.
The top entry will be the closest.

Repeat for the next business, etc.
--
Gary''s Student - gsnu200810


"Christian Falde" wrote:

Hi,

I am not sure where else to ask but this seems like the place.

My job uses Office 2000. Let the groaning commence. What I am trying to do
is create a Macro in Excel 2000 that duplicates what a macro in SAS does?

The macro in SAS takes the Longitude and Latitude for a business, goes
through a list of all our store location long and lat and figures the
distance, then keeps the minimun distance.

There are about 1020 Store locations. The number of Business is currently
10 though that number could change depending on sales.

SAS works great for things like this. The idea is to get it into Excel and
then let the department requesting the information do it on their own.

Any advice would be greatly.

Thanks
Christian Falde