TRAVELDISTANCE Function – Google Sheets

TRAVELDISTANCE helps spreadsheet users plan trips by finding the distance between two points. This function can calculate the distance for hundreds of address pairs in seconds.

❗This custom function is only available to users of the Travel Formulas add-on from the Google Workspace Marketplace. Travel Formulas uses Google Maps for you while you stay in your spreadsheet.

Function help for TRAVELDISTANCE

💡 Need Travel Time Calculations in Your Spreadsheet?

Travel Formulas gives you TRAVELDISTANCE plus three other powerful functions—no API keys, no complexity. Calculate travel times, distances, and get turn-by-turn directions for hundreds of location pairs.

Perfect for: Commute planning, delivery scheduling, territory analysis, fleet management, real estate research

Get Travel Formulas | Learn more about features

Purpose

The TRAVELDISTANCE function returns the distance between locations.

All Travel Formulas

TRAVELTIME – Returns the trip duration between locations

TRAVELDISTANCE – Finds the trip distance between locations

TRAVELROUTEURL – Returns the link to your route in Google Maps™

TRAVELDIRECTIONS – Provides turn-by-turn directions

Syntax

=TRAVELDISTANCE(origin, destination, mode, unit)

origin – The starting location in any format (address, place name, coordinates, etc.)

destination – The ending location in any format

mode – The mode of travel (“driving”, “walking”, “bicycling”, “transit”) [optional, defaults to driving]

unit – The unit of distance (“mi”, “km”) [optional, defaults to miles]

Examples

Example 1 – Two Addresses

Let’s keep it simple at first and use two cities: one for the origin and the other for the destination.

The TRAVELDISTANCE formula finding the distance between New York and Los Angeles
Two Addresses

These locations are just a bit oversimplified. But if Google Maps accepts them, the formulas work! The trip from New York to Los Angeles turns out to be way too long at 2,790 miles.

This function accepts direct input such as “NY” but can also use cell references. We’ll switch to using cell references for the following examples, as they give us more flexibility.

Example 2 – Different Modes

We can evaluate driving, mass transit, biking, and walking. These mileages can be significantly different within the same city. Let’s travel through Chicago using these different modes.

The TRAVELDISTANCE function calculating distance with different modes of transportation
Different Modes of Travel

A bike ride is the same distance as driving, while you can take some shortcuts if you walk and save two miles.

Example 3 – Different Units

Let’s say you’re an American but want to use a more logical measurement unit. You can change the formula to use kilometers.

The TRAVELDISTANCE formula with miles and kilometers
Different Units

Now, our non-American friends can enjoy some measurements, too.

Example 4 – Different Location Formats

You don’t have to use a city name or full address. Other geolocation methods, such as Plus codes and coordinates, also work, as shown below.

Different location formats  that work with the function
Different Location Formats

Rows 2 through 6 in the image above use the same locations but different methods to specify them. You can use a city name, a full address, a place name, plus code, or even latitude and longitude.

Frequently Asked Questions

How accurate is TRAVELDISTANCE?

TRAVELDISTANCE uses Google Maps routing data, so it’s as accurate as Google Maps itself. The function returns actual driving, walking, bicycling, or transit distances along real routes—not straight-line distances. Results match what you’d see if you manually entered the same locations in Google Maps.

Does TRAVELDISTANCE work internationally?

Yes! TRAVELDISTANCE works worldwide wherever Google Maps has coverage. You can calculate distances between any two locations globally—from Paris to Tokyo, Sydney to Cape Town, or anywhere in between. The function automatically handles different address formats, languages, and measurement units.

What’s the difference between TRAVELDISTANCE and using the Google Maps API directly?

While you could write custom scripts to call the Google Maps Distance Matrix API directly, TRAVELDISTANCE eliminates all the complexity. You don’t need to manage API keys, handle authentication, parse JSON responses, or worry about rate limits and error handling. TRAVELDISTANCE gives you a simple formula that just works—type addresses, get distances.

Can I use TRAVELDISTANCE for bulk distance calculations?

Absolutely! TRAVELDISTANCE is designed for bulk calculations. You can drag the formula down to calculate distances for hundreds or thousands of address pairs in your spreadsheet. Travel Formulas handles large datasets efficiently without the quota restrictions and complexity of manual API integration.

When should I use TripTally instead of TRAVELDISTANCE?

Use TRAVELDISTANCE when your data is already in Google Sheets and you want formula-based calculations. Use TripTally when you need a simpler interface, want to quickly calculate a few distances without setting up formulas or prefer a graphical user interface. Both use the same accurate Google Maps data.

Conclusion

The TRAVELDISTANCE formula is a versatile tool that helps you plan your trips without leaving Google Sheets. Whether you’re calculating a single route or building a distance matrix for hundreds of locations, it handles the heavy lifting while you stay focused on your data.

TRAVELDISTANCE is one of four powerful functions included with Travel Formulas. Pair it with TRAVELTIME to get both distance and duration, or use TRAVELDIRECTIONS for turn-by-turn navigation — all from within your spreadsheet.

Get Travel Formulas from the Google Workspace Marketplace →