Calculate Distances Between Two Addresses or Points

The shortest distance between two points is a straight line, but how long is that line? When it comes to those two points, you may know them as GPS coordinates, or you may only have addresses. Even if you know each latitude and longitude, the math behind the distance calculation is complicated. There are several approaches and tools you can use to make it easier, even bringing the calculations to every row of a spreadsheet. We’ll cover a few options below to get you started with calculating distances.

Many Distances from a Single Place

Calculating a single distance is easy. In fact, we do it all the time using Google Maps and other directions services. Of course, that distance is typically a driving distance instead of the straight line distance. Nevertheless, when you find yourself needing to know multiple distances, the most common reason is you want to find out which locations are closest to single point, such as your current location.

Let’s say you have a spreadsheet of addresses of your city’s mechanics. Your car is broken down and you don’t want to have to push or tow it any farther than necessary.

Santa Monica Mechanics

Add your address, or the address of wherever you want to use as a reference location in the first row of your spreadsheet, just after the header row.

Santa Monica Mechanics (with my location)

Now highlight and copy your entire spreadsheet (including the header row) and paste it into our simple map making tool. Click Validate and Set Options, then choose Advanced Options. Check the option to calculate distance from the first address. Then click Make Map.

View Santa Monica Mechanics in a full screen map

Now when you see the map, the distance is listed along with the other data with each marker. Since we used letters to label the markers, we know that Marker A is our first row, which is used to calculate the distance for all the other markers.

Break Out Your Digital Measuring Tape

Calculating the distance across all your locations is incredibly useful. Yet, sometimes you want to perform ad hoc measurements between many markers. That’s where the measuring tools that are part of BatchGeo’s Advanced Mode come in handy.

You can check whether Advanced Mode is active, and activate it if necessary, using the Pro menu in the upper right corner of any map. You must be a BatchGeo Pro member and logged in to use Advanced Mode. If Advanced Mode is active, you’ll see several buttons near the zoom controls in the upper left corner of your map.

Manually measure distances

Select the measuring tool, the button with a ruler icon. The hand cursor will become a plus sign target. Now click and hold where you want to begin a measurement (such as one of the markers). Next, drag the cursor to the end of your measurement. As you drag, you’ll see the current distance from the initial point to the current cursor. To switch between metric and imperial systems, click the scale on the bottom right of the map.

Deploy the Haversine Formula in Your Spreadsheet

The absolute best way to view geographic data is from a map, which is why BatchGeo lets you map Excel data (and other spreadsheets) with our simple copy-paste interface. However, if you need the distances in your spreadsheet directly, you’ll need to include a complex series of functions.

Santa Monica Mechanics (with distances)

Let’s say you know the latitude and longitude points of those mechanics stored in columns B (latitude) and C (longitude) of your spreadsheet. Using a formula derived from this site, you could calculate the distance from Fleece’s Greases (row 3) to your location (row 2) using this formula:

=3958*ACOS(SIN(B$2*PI()/180)*SIN(B3*PI()/180) + COS(B$2*PI()/180)*COS(B3*PI()/180)*COS(C3*PI()/180-C$2*PI()/180))

You can change the 3,958 — the approximate radius of the earth in miles — to another unit, such as kilometers (6,371), meters (6,371,000), or feet (20,898,240). The rest is advanced math based on the spherical law of cosines. The important parts are the B$2 and C$2, which ensure you’ll compare other rows in the spreadsheet to your location, affixed in that second row. When you copy and paste this formula, the other fields will update to correctly reference the current row.

The haversine formula only works if you know your latitude and longitude points. If all you have is addresses, BatchGeo can help: create a map with measurements from a single distance (as in the first section above), and copy the data back out to your spreadsheet. Go to edit your map, copy the entire data, and you’ll see the distance as the final column when you paste into an empty spreadsheet.

Edit Map Data to Get Distances

The best part is that your map will still be there as a visual representation of the same data. Naturally, we think a map is a great way to augment the data in your spreadsheet. These different methods of calculating distances have varied levels of difficulty and usefulness, depending on the data you have available. Why not try creating a map now for free?

100 Years Later: Here’s a Map of Major 1917 Events

It’s been 100 years since 1917, a year clouded with events mostly centered in Europe. World War I had dragged on since 1914 with little hope of peace or victory. Though involved in the war, Russia had a lot more to consider when its government collapsed in February. Many of the events of 1917 fall into these two categories, but as you’ll see on the map below, there was a lot going on that year. Peruse the map, or read on for highlights from one hundred years ago.

View 1917: Map of Historical Significance in a full screen map

World War I

The Western Front is the most well known area of warfare, but it was hardly the only place to see action. The west was the primary battlefield, but remember the war initially broke out due to the assassination of Archduke Franz Ferdinand in eastern Europe. Among the countries with WWI-related events, based on Wikipedia’s list, are Belgium, Brazil, Canada, China, Egypt, England, Estonia, France, Germany, Iraq, Ireland, Isle of Wight, Israel (then Palestine), Italy, Jordan, Mozambique, Russia, Scotland, Serbia, Spain, Ukraine, and the United States. There’s a good reason it became known as a World War.

Using the map above, click the WWI category to restrict only those events related to WWI on the map. Now you’ll see how widespread the markers are, though there’s clearly a cluster around Europe and the Middle East. Most of the far-flung locations are declarations of war from the likes of the United States, Brazil, and China. Interestingly, one outlier was actually a battle. In November, Germany and Portugal battled near the border of modern-day Mozambique and Tanzania. Outside of very northern Egypt, on the Sinai Peninsula, that’s the only notable event of 1917 in Africa.

Other 1917 WWI events include a battle led by Lawrence of Arabia, anarchists in Milan, and a Russian mutiny in Ukraine.

Russian Revolution

In March 2017, members of the Tsar’s Imperial Parliament formed a provisional government, which encouraged Tsar Nicholas to abdicate his role of Emperor. Later in the year, the Bolsheviks, led by Vladimir Lenin, would overthrow the provisional government and establish what eventually became the Soviet Union. Quite a year, right?

Most of the revolution took place in Saint Petersburg, the capital then known as Petrograd. It’s the marker near Finland, which has 14 separate events

As part of the Russian Revolution, other countries once ruled by Russia asserted their independence, including Georgia, Estonia, and Finland.

Other Political Events

With a war and a major revolution, there was plenty of politics happening all over the world. Among them: Sweden received two new prime ministers in the same year. Canada enacted its first income tax. And Mexico enacted a new constitution.

The United States joined the war early in 1917, but still had plenty of action on the homefront. In March, Jeannette Rankin could not even vote for herself when she became the first woman in the US House of Representatives (representing Montana). In the Caribbean, the US purchased the Virgin Islands and granted Puerto Ricans US citizenship.

You can see other political happenings on the map by clicking Politics the the Category selection.

Other Highlights

1917 was definitely a year for war, politics, and revolution, but here are a few other highlights from the year:

  • The NHL is formed in Montreal
  • Children in Portugal claim to see Mary, mother of Jesus
  • The first Pulitzer Prize is awarded in New York City
  • Bombs, crashes, and explosions galore—click the Distaster category to see more

It was a raucous year and here we are, one hundred years later. Click around to see more, or plot some history with your own map today.

Map Where You’ve Been (And Where You Want to Go)

Are you going to travel to any new countries, states, or cities this year? How many have you already visited? Many people have goals to visit a certain number of new places every year, or a big total like 50 or 100 countries in their lifetime. Now is a great time to make such a resolution—and there is no better way to track it than a map.

View Which Countries Have I Visited? in a full screen map

Take the example above, which shows the countries I’ve visited in green. The nations I want to visit are in red. You can make your own map almost entirely from your spreadsheet. That way, you can easily update it every time you visit a new place. Follow the steps below to create your own “been there, not done that” type of map. Or, get really creative and plot anything that fits the pattern.

How to Map Where You’ve Been

Creating a map of the countries you’ve visited is as simple as making a list. In fact, you don’t even need to use a spreadsheet unless you want to (though it will make the next step easier). Just start your list with “Country” as the heading and put each country on its own line.

Spreadsheet of countries visited

I put mine into Excel, and then highlighted the entire list. Don’t worry if you forget one—you can go back and edit it later. Copy your list and head over to the mapping tool on our homepage. Just paste the list into the big box at the top of the page. To get going quickly, just click “Map Now.” We’ll show some other cool settings in the next step.

Faster than it likely took you to remember the countries you’ve visited, you now have a map. The marker pin is plotted into roughly the center of the country, based on the coordinates we get back from the Google Geocoder we use. When you visit another country (or realize you forgot one), just add it to your list, then copy the entire list into this map (we’ll email you a link you can use to edit the map).

How to Map Where You Want to Go

Maps get really fun and useful when you have multiple types of data represented on the same map. Let’s make that map show not only where you’ve been, but where you want to go.

Now is the time where it’s useful to keep this data in a spreadsheet. If you haven’t already, copy your list of countries visited into Excel, Google Sheets, or a similar program for storing data as a table. Now add a second column, just to the right of the country column. Let’s call it Type.

Spreadsheet of countries visited and those I want to visit

We’ll have two types for this map: Been and Want. You can name them whatever you want. You could even add other types to describe how much you want to go, or maybe to list places you don’t want to go. That’s up to you, but we’ll stick to the simple two type map for this example. Write “Been” in the Type column for all the countries you’ve visited. Now add some countries you want to visit in the Country column, and write “Want” in the Type column for each of those.

Now take those two columns, including the headers, and paste them into BatchGeo. This time, instead of simply making the map, click Validate & Set Options. Make sure the Region is set to International. Set the Country to your country field. Group By may already be selected as Type, but you can double check, then click Advanced Options. In the Marker colors section you can choose from the colors to represent each of your marker types.

Click the Make Map button and away you go. Now you have a map of everywhere you’ve been… and everywhere you want to go! You can also use this same process for many different types of maps, like the one below that shows where the Olympics have been, as well as where they will be going in the future.

Where Were the Olympics?

View Olympics Locations in a full screen map

For over 100 years, the Olympics have brought the world together to compete in many countries. Above you see a modification of the visited countries map to show where athletes have competed in the Olympics. You’ll also notice a handful of markers representing the cities that are to be homes of future olympics.

What other data do you have—perhaps sitting on your hard drive as spreadsheets—that would be better represented as a map?