Geocode function
The Excel Geocode function returns geographic information, given the name of a place.
Usage:
=geocode(request, location)
Where:
request is the information desired (“latitude”, “longitude”, “postcode”, … complete list)
location is an address, a city, a country or the name of a point of interest
Examples:
Excel Formula | Result | Remarks |
=Geocode(“status”,”High Street, London”) | 5 matches | Which one? Newham, Croydon, Barnet, Waltham Forest or Stratford? |
=Geocode(“latitude”,”High Street, London”) | Blank because there are 5 (ambiguous) answers | |
=Geocode(“status”,”14, Camden High Street UK”) | OK | 0 |
=Geocode(“latitude”,”14, Camden High Street UK”) | 51.5346889 | Numbers, not text |
=Geocode(“longitude”,”14, Camden High Street UK”) | -0.1386746 | 0 |
=Geocode(“formatted_address”,”14, Camden High Street UK”) | 14 Camden High St, Camden Town, Greater London NW1 2, UK | 0 |
=Geocode(“types”,”métro Trocadéro paris”) | subway_station establishment transit_station | ‘types’ describes what the place is. It is not always present |
=Geocode(“postal_code”,”Kinkakuji”) | 603-8361 | Golden Temple, Kyoto, Japan (you knew that, of course) |
=Geocode(“country political”,”Mweka”) | Democratic Republic of the Congo | but I bet you didn’t know that! |
0 | 0 | 0 |
=Geocode(“fields”) | 32 | There are (currently) 32 fields available |
=Geocode(“field”,1) | status | The first field is ‘status’ |
=Geocode(“field”,2) | coordinates | The second field is ‘coordinates’ |
=Geocode(“field”,3) | latitude | etc. |
Notes:
- If there are any errors, only the ‘status’ field is populated, all the others return blank (first example above)
- It is therefore very important to always display the status field, otherwise you will not see why a field is blank