A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear @LaAiesha Jones,
Thank you for reaching out to the Microsoft 365 Q&A forum. Calculating mileage directly between two addresses in Excel is a common request, but it is important to clarify that Excel does not have a native "out-of-the-box" function (like =MILEAGE()) to calculate driving distance. This is because Excel doesn't inherently "know" the road maps or traffic patterns between two points.
However, there are three professional ways I recommend solving this, depending on the user’s technical comfort level.
Option 1: The "New" Excel Way (Bing Maps Add-in)
This is the most user-friendly method and uses official Microsoft tools.
- Go to the Home tab and select Get Add-ins.
- Search for "Bing Maps" and add it.
- Select your cells containing the addresses.
- Click the Bing Maps icon in your spreadsheet. It will plot the points, and while it primarily visualizes data, it allows for quick distance reference without leaving the app.
Option 2: Using the WEBSERVICE Function (Advanced)
If the user wants a formula that updates automatically, they can use Excel's WEBSERVICE function to pull data from the Bing Maps API.
The Logic: The formula sends the addresses to Bing, and Bing sends back the distance. The user will need a free Bing Maps API Key.
The Formula Structure:
=WEBSERVICE(“http://mywebservice.com/serviceEndpoint?searchString=Excel”)
Note: This returns a string of XML code. You would then need to use the FILTERXML function to "pluck" the specific mileage number out of that code.
For further details, you may refer to: WEBSERVICE function - Microsoft Support
Option 3: Power Query (The professional choice)
For large lists of addresses, Power Query is the most robust tool. It can connect to an external API (like Google Maps or Bing Maps) to transform a column of "Address A" and "Address B" into a "Distance" column.
I understand you're looking for a direct way to calculate mileage between addresses. While Excel doesn’t have a built-in 'Distance' button, the most efficient professional method is to use the Bing Maps Add-in for visualization, or the WEBSERVICE function if you are comfortable using an API key for automated calculations. For a simple, one-time calculation, many users find that the Bing Maps Add-in provides the quickest results without needing complex formulas.
As a forum moderator, I don’t have the necessary tools or permissions to fully investigate Power Query forum specific issues like this. These require review by teams specializing in Power Query and Excel data models.
To get accurate assistance, I recommend posting your question in the Power Query – Microsoft Fabric Community, where product experts can review your scenario in detail.
You can point the customer to the Bing Maps Dev Center to get started with the necessary keys for automated formulas.
I hope this clarifies the current situation. Please let me know if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.